In nodelock show program name if node is already locked

This commit is contained in:
Michiel Broek 2005-10-09 13:51:59 +00:00
parent ce1a91279d
commit 87b2b022a2
2 changed files with 10 additions and 2 deletions

View File

@ -7,6 +7,9 @@ v0.81.0 07-Oct-2005
The bbs menu Change Screenlength is obsolete. Remove this from The bbs menu Change Screenlength is obsolete. Remove this from
the menus (setup.mnu) and ascii/ansi screens (setup.a??). the menus (setup.mnu) and ascii/ansi screens (setup.a??).
libmbse.a:
In nodelock show program name if node is already locked.
mbcico: mbcico:
Made binkp GZ and BZ2 compression final. Made binkp GZ and BZ2 compression final.

View File

@ -35,7 +35,7 @@
int nodelock(faddr *addr, pid_t mypid) int nodelock(faddr *addr, pid_t mypid)
{ {
char *fn, *tfn, *p, tmp[16]; char *fn, *tfn, *p, tmp[16], *progname;
FILE *fp; FILE *fp;
pid_t pid; pid_t pid;
int tmppid, sverr, rc; int tmppid, sverr, rc;
@ -119,7 +119,12 @@ int nodelock(faddr *addr, pid_t mypid)
Syslog('+', "Found lock older then 6 hours for %s, unlink", ascfnode(addr,0x1f)); Syslog('+', "Found lock older then 6 hours for %s, unlink", ascfnode(addr,0x1f));
unlink(fn); unlink(fn);
} else { } else {
progname = calloc(PATH_MAX, sizeof(char));
if (pid2prog(pid, progname, PATH_MAX) == 0)
Syslog('+', "Node %s is locked by pid %d (%s)", ascfnode(addr, 0x1f), pid, progname);
else
Syslog('+', "Node %s is locked by pid %d", ascfnode(addr, 0x1f), pid); Syslog('+', "Node %s is locked by pid %d", ascfnode(addr, 0x1f), pid);
free(progname);
unlink(tfn); unlink(tfn);
free(tfn); free(tfn);
return 1; return 1;