s3: Fix count_current_connections
authorVolker Lendecke <vl@samba.org>
Tue, 14 Jun 2011 15:50:41 +0000 (17:50 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 14 Jun 2011 15:55:30 +0000 (17:55 +0200)
"False" is not really a valid return value for "int"..

source3/smbd/connection.c

index 8560a5d211be3223ea266138524fd9717ba736a1..08afd92f6e71204b64d73298eeaa88f7c1682ae5 100644 (file)
@@ -101,6 +101,7 @@ static int count_fn(struct db_record *rec,
 int count_current_connections( const char *sharename, bool clear  )
 {
        struct count_stat cs;
+       int ret;
 
        cs.curr_connections = 0;
        cs.name = sharename;
@@ -111,10 +112,11 @@ int count_current_connections( const char *sharename, bool clear  )
         * as it leads to deadlock.
         */
 
-       if (connections_forall(count_fn, &cs) == -1) {
+       ret = connections_forall(count_fn, &cs);
+       if (ret == -1) {
                DEBUG(0,("count_current_connections: traverse of "
                         "connections.tdb failed\n"));
-               return False;
+               return 0;
        }
 
        return cs.curr_connections;