From: Andrew Tridgell Date: Thu, 10 Dec 1998 14:31:20 +0000 (+0000) Subject: allow smbd to be started without a STATUS..LCK file X-Git-Tag: samba-2.0.0beta4~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83b04cf6874698c71e7ea74d040b8eb18e91390e;p=thirdparty%2Fsamba.git allow smbd to be started without a STATUS..LCK file --- diff --git a/source/web/statuspage.c b/source/web/statuspage.c index faf1dcb20d6..260e00cb83d 100644 --- a/source/web/statuspage.c +++ b/source/web/statuspage.c @@ -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("\n"); printf("\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("
PIDClientIP addressDateKill

\n"); - fseek(f, 0, SEEK_SET); + if (f) fseek(f, 0, SEEK_SET); printf("

Active Shares

\n"); printf("\n"); printf("\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("
ShareUserGroupPIDClientDate
\n"); - fclose(f); + if (f) fclose(f); printf("\n");