diff options
Diffstat (limited to 'source/utils/status.c')
-rw-r--r-- | source/utils/status.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/utils/status.c b/source/utils/status.c index ed0ae532114..3d520564895 100644 --- a/source/utils/status.c +++ b/source/utils/status.c @@ -28,22 +28,18 @@ #endif #include "includes.h" -#include "loadparm.h" struct connect_record crec; extern int DEBUGLEVEL; extern FILE *dbf; +extern pstring myhostname; static pstring Ucrit_username = ""; /* added by OH */ int Ucrit_pid[100]; /* Ugly !!! */ /* added by OH */ int Ucrit_MaxPid=0; /* added by OH */ unsigned int Ucrit_IsActive = 0; /* added by OH */ -void Ucrit_addUsername(pstring username); /* added by OH */ -unsigned int Ucrit_checkUsername(pstring username); /* added by OH */ -void Ucrit_addPid(int pid); /* added by OH */ -unsigned int Ucrit_checkPid(int pid); /* added by OH */ -int main(int argc, char *argv[]) + int main(int argc, char *argv[]) { FILE *f; pstring fname; @@ -57,6 +53,7 @@ int main(int argc, char *argv[]) BOOL processes_only=False; int last_pid=0; + TimeInit(); setup_logging(argv[0],True); charset_initialise(); @@ -69,7 +66,7 @@ int main(int argc, char *argv[]) return(1); } - while ((c = getopt(argc, argv, "pdsu:")) != EOF) { + while ((c = getopt(argc, argv, "pds:u:")) != EOF) { switch (c) { case 'd': verbose = 1; @@ -89,13 +86,13 @@ int main(int argc, char *argv[]) } } - - if (!lp_load(servicesf,False)) { fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf); return (-1); } + get_myname(myhostname, NULL); + if (verbose) { printf("using configfile = %s\n", servicesf); printf("lockdir = %s\n", *lp_lockdir() ? lp_lockdir() : "NULL"); @@ -113,6 +110,9 @@ int main(int argc, char *argv[]) printf("You need to have status=yes in your smb config file\n"); return(0); } + else if (verbose) { + printf("Opened status file %s\n", fname); + } uid = getuid(); @@ -142,7 +142,7 @@ int main(int argc, char *argv[]) printf("%-10.10s %-8s %-8s %5d %-8s (%s) %s", crec.name,uidtoname(crec.uid),gidtoname(crec.gid),crec.pid, crec.machine,crec.addr, - asctime(LocalTime(&crec.start,GMT_TO_LOCAL))); + asctime(LocalTime(&crec.start))); } } fclose(f); @@ -213,7 +213,7 @@ int main(int argc, char *argv[]) case 1: printf("WRONLY "); break; case 2: printf("RDWR "); break; } - printf(" %s %s",fname,asctime(LocalTime(&t,GMT_TO_LOCAL))); + printf(" %s %s",fname,asctime(LocalTime(&t))); } closedir(dir); |