mirror of
				https://github.com/berlin-open-wireless-lab/DAWN.git
				synced 2025-03-09 15:40:12 +00:00 
			
		
		
		
	dawn_uci: no need uci_alloc_context on each uci_set_network call
This commit is contained in:
		
							parent
							
								
									67c3ed0d0a
								
							
						
					
					
						commit
						32640de378
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -201,6 +201,7 @@ int uci_init() {
 | 
			
		|||
 | 
			
		||||
        ctx->flags &= ~UCI_FLAG_STRICT;
 | 
			
		||||
    } else {
 | 
			
		||||
        ctx->flags &= ~UCI_FLAG_STRICT;
 | 
			
		||||
        // shouldn't happen?
 | 
			
		||||
        uci_pkg = uci_lookup_package(ctx, "dawn");
 | 
			
		||||
        if (uci_pkg)
 | 
			
		||||
| 
						 | 
				
			
			@ -227,9 +228,13 @@ int uci_set_network(char* uci_cmd)
 | 
			
		|||
{
 | 
			
		||||
    struct uci_ptr ptr;
 | 
			
		||||
    int ret = UCI_OK;
 | 
			
		||||
    struct uci_context *ctx;
 | 
			
		||||
    struct uci_context *ctx  = uci_ctx;
 | 
			
		||||
 | 
			
		||||
    if (!ctx) {
 | 
			
		||||
        ctx = uci_alloc_context();
 | 
			
		||||
        uci_ctx = ctx;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ctx = uci_alloc_context();
 | 
			
		||||
    ctx->flags |= UCI_FLAG_STRICT;
 | 
			
		||||
 | 
			
		||||
    if (uci_lookup_ptr(ctx, &ptr, uci_cmd, 1) != UCI_OK) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue