a couple of minor merges from 2_2
authorAndrew Tridgell <tridge@samba.org>
Sun, 22 Apr 2001 03:16:04 +0000 (03:16 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 22 Apr 2001 03:16:04 +0000 (03:16 +0000)
source/client/client.c
source/client/smbmount.c
source/client/smbspool.c

index 1d48ac0f711f14518b205a2af7448a4effac844c..9c167e20c2cb2cc993b3603e0cccf61f8e19cb70 100644 (file)
@@ -2201,6 +2201,7 @@ static int do_message_op(void)
        extern FILE *dbf;
        extern char *optarg;
        extern int optind;
+       int old_debug;
        pstring query_host;
        BOOL message = False;
        extern char tar_type;
@@ -2253,9 +2254,11 @@ static int do_message_op(void)
 
        in_client = True;   /* Make sure that we tell lp_load we are */
 
+       old_debug = DEBUGLEVEL;
        if (!lp_load(servicesf,True,False,False)) {
                fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf);
        }
+       DEBUGLEVEL = old_debug;
        
        codepage_initialise(lp_client_code_page());
 
index 7da96ba8c3508dd6300bbd6d2f09af4b43eb40a5..a121d1fa22d635d12c49787fac092e398b677542 100644 (file)
@@ -95,10 +95,12 @@ static void daemonize(void)
 static void close_our_files(int client_fd)
 {
        int i;
+       struct rlimit limits;
 
        getrlimit(RLIMIT_NOFILE,&limits);
-       for (1 = 0; i< limits.rlim_max, i++) {
-               if (i == client_fd) continue;
+       for (i = 0; i< limits.rlim_max; i++) {
+               if (i == client_fd)
+                       continue;
                close(i);
        }
 }
index 581b6508b8deb00b1eba22074456d24f0472f80b..b0077b73baeef42db63db3a6e183cab43bdbd959 100644 (file)
@@ -59,7 +59,7 @@ static int            smb_print(struct cli_state *, char *, FILE *);
                *server,        /* Server name */
                *printer;       /* Printer name */
   FILE         *fp;            /* File to print */
-  int          status;         /* Status of LPD job */
+  int          status=0;               /* Status of LPD job */
   struct cli_state *cli;       /* SMB interface */
 
   /* we expect the URI in argv[0]. Detect the case where it is in argv[1] and cope */