loadparm: add utility function to check for config backend file.
authorMichael Adam <obnox@samba.org>
Tue, 11 Mar 2008 11:41:20 +0000 (12:41 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 12 Mar 2008 01:12:33 +0000 (02:12 +0100)
Michael

source/param/loadparm.c

index c47e70492a5e24134ec9901a7fcd83c21c10c0dc..8dfc432924625ef46ce3f0a67f5999224076bc29 100644 (file)
@@ -6586,6 +6586,14 @@ bool lp_config_backend_is_registry(void)
        return (lp_config_backend() == CONFIG_BACKEND_REGISTRY);
 }
 
+/**
+ * Utility function to check if the config backend is FILE.
+ */
+bool lp_config_backend_is_file(void)
+{
+       return (lp_config_backend() == CONFIG_BACKEND_FILE);
+}
+
 /*******************************************************************
  Check if a config file has changed date.
 ********************************************************************/
@@ -8666,7 +8674,7 @@ bool lp_load(const char *pszFname,
                Globals.param_opt = NULL;
        }
 
-       if (lp_config_backend() == CONFIG_BACKEND_FILE) {
+       if (lp_config_backend_is_file()) {
                n2 = alloc_sub_basic(get_current_username(),
                                        current_user_info.domain,
                                        pszFname);