The branch, master has been updated
       via  61b2ac9 s3: Avoid a ton of registry writes at startup
       via  849816d s3: Fix a type error
       via  5a3bc19 s3: Fix some nonempty blank lines
      from  04987bd Explicitly set "nmbd: socket dir" in the test environment.

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


- Log -----------------------------------------------------------------
commit 61b2ac91210a1d34f47cb480c222b9ae64546180
Author: Volker Lendecke <v...@samba.org>
Date:   Sat Jan 8 11:51:17 2011 +0100

    s3: Avoid a ton of registry writes at startup
    
    Autobuild-User: Volker Lendecke <vlen...@samba.org>
    Autobuild-Date: Sat Jan  8 12:39:09 CET 2011 on sn-devel-104

commit 849816d0dfa18dad6b972f349c2f1d27e5a70a32
Author: Volker Lendecke <v...@samba.org>
Date:   Sat Jan 8 11:28:47 2011 +0100

    s3: Fix a type error

commit 5a3bc194add28badcffa27c0a87a7b673d57cbe5
Author: Volker Lendecke <v...@samba.org>
Date:   Sat Jan 8 11:28:27 2011 +0100

    s3: Fix some nonempty blank lines

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

Summary of changes:
 source3/services/services_db.c |   18 ++++++++++++++++++
 source3/web/diagnose.c         |   10 +++++-----
 2 files changed, 23 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/services/services_db.c b/source3/services/services_db.c
index ca375d2..03f7951 100644
--- a/source3/services/services_db.c
+++ b/source3/services/services_db.c
@@ -270,6 +270,24 @@ static WERROR svcctl_setvalue(struct registry_key *key,
                              struct registry_value *value)
 {
        WERROR wresult;
+       struct registry_value *existing;
+
+       wresult = reg_queryvalue(talloc_tos(), key, name, &existing);
+       if (W_ERROR_IS_OK(wresult)) {
+               bool exists;
+
+               exists = ((value->type == existing->type) &&
+                         (data_blob_cmp(&value->data, &existing->data) == 0));
+
+               TALLOC_FREE(existing);
+
+               if (exists) {
+                       /*
+                        * Avoid an expensive write when not necessary
+                        */
+                       return WERR_OK;
+               }
+       }
 
        wresult = reg_setvalue(key, name, value);
        if (!W_ERROR_IS_OK(wresult)) {
diff --git a/source3/web/diagnose.c b/source3/web/diagnose.c
index fb95f0f..4a44012 100644
--- a/source3/web/diagnose.c
+++ b/source3/web/diagnose.c
@@ -2,17 +2,17 @@
    Unix SMB/CIFS implementation.
    diagnosis tools for web admin
    Copyright (C) Andrew Tridgell 1998
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -35,7 +35,7 @@ bool winbindd_running(void)
 bool nmbd_running(void)
 {
        struct in_addr loopback_ip;
-       int count, flags;
+       int count;
        struct sockaddr_storage *ss_list;
        struct sockaddr_storage ss;
        NTSTATUS status;
@@ -46,7 +46,7 @@ bool nmbd_running(void)
        status = name_query("__SAMBA__", 0,
                            True, True, &ss,
                            talloc_tos(), &ss_list, &count,
-                           &flags);
+                           NULL);
        if (NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(ss_list);
                return True;


-- 
Samba Shared Repository

Reply via email to