]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
allow smbd to be started without a STATUS..LCK file
authorAndrew Tridgell <tridge@samba.org>
Thu, 10 Dec 1998 14:31:20 +0000 (14:31 +0000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 10 Dec 1998 14:31:20 +0000 (14:31 +0000)
source/web/statuspage.c

index faf1dcb20d613acf6a2baafecae5f1bd8611dc43..260e00cb83d1df400acbbf8d5a07c8596cb82ce9 100644 (file)
@@ -162,7 +162,6 @@ void status_page(void)
                printf("Couldn't open status file %s\n",fname);
                if (!lp_status(-1))
                        printf("You need to have status=yes in your smb config file\n");
-               return;
        }
 
 
@@ -195,7 +194,7 @@ void status_page(void)
        printf("<table border=1>\n");
        printf("<tr><th>PID</th><th>Client</th><th>IP address</th><th>Date</th><th>Kill</th></tr>\n");
 
-       while (!feof(f)) {
+       while (f && !feof(f)) {
                if (fread(&crec,sizeof(crec),1,f) != 1)
                        break;
                if (crec.magic == 0x280267 && 
@@ -211,13 +210,13 @@ void status_page(void)
 
        printf("</table><p>\n");
 
-       fseek(f, 0, SEEK_SET);
+       if (f) fseek(f, 0, SEEK_SET);
        
        printf("<p><h3>Active Shares</h3>\n");
        printf("<table border=1>\n");
        printf("<tr><th>Share</th><th>User</th><th>Group</th><th>PID</th><th>Client</th><th>Date</th></tr>\n\n");
 
-       while (!feof(f)) {
+       while (f && !feof(f)) {
                if (fread(&crec,sizeof(crec),1,f) != 1)
                        break;
                if (crec.cnum == -1) continue;
@@ -241,7 +240,7 @@ void status_page(void)
        locking_end();
        printf("</table>\n");
 
-       fclose(f);
+       if (f) fclose(f);
 
        printf("</FORM>\n");