[SCM] Samba Shared Repository - branch master updated

Garming Sam garming at samba.org
Wed Jan 28 16:30:11 MST 2015


The branch, master has been updated
       via  ce909f2 loadparm: Simplify "set_variable"
      from  62671ad7 uwrap: Bump version to 1.1.0.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ce909f2ce17e410c223a7e76cf4edc52a71aa663
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jan 28 16:16:32 2015 +0000

    loadparm: Simplify "set_variable"
    
    I usually don't like complicated if/else and in particular the else
    piece. But if the alternative is a goto, then else is better I guess :-)
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    
    Autobuild-User(master): Garming Sam <garming at samba.org>
    Autobuild-Date(master): Thu Jan 29 00:28:55 CET 2015 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 lib/param/loadparm.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index bfa9c7b..115575c 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -1567,19 +1567,15 @@ bool set_variable(TALLOC_CTX *mem_ctx, struct loadparm_service *service, int par
 	if (parm_table[parmnum].special) {
 		ok = parm_table[parmnum].special(lp_ctx, service, pszParmValue,
 						  (char **)parm_ptr);
-		if (!ok) {
-			return false;
-		}
-		goto mark_non_default;
+	} else {
+		ok = set_variable_helper(mem_ctx, parmnum, parm_ptr,
+					 pszParmName, pszParmValue);
 	}
 
-	ok = set_variable_helper(mem_ctx, parmnum, parm_ptr, pszParmName, pszParmValue);
-
 	if (!ok) {
 		return false;
 	}
 
-mark_non_default:
 	if (on_globals && (lp_ctx->flags[parmnum] & FLAG_DEFAULT)) {
 		lp_ctx->flags[parmnum] &= ~FLAG_DEFAULT;
 		/* we have to also unset FLAG_DEFAULT on aliases */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list