From 87b2b022a2ae5b9b957c15de3133671b341af633 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sun, 9 Oct 2005 13:51:59 +0000 Subject: [PATCH] In nodelock show program name if node is already locked --- ChangeLog | 3 +++ lib/nodelock.c | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a745a1e..3756a1ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,9 @@ v0.81.0 07-Oct-2005 The bbs menu Change Screenlength is obsolete. Remove this from the menus (setup.mnu) and ascii/ansi screens (setup.a??). + libmbse.a: + In nodelock show program name if node is already locked. + mbcico: Made binkp GZ and BZ2 compression final. diff --git a/lib/nodelock.c b/lib/nodelock.c index 0fa03b27..777afc8f 100644 --- a/lib/nodelock.c +++ b/lib/nodelock.c @@ -35,7 +35,7 @@ int nodelock(faddr *addr, pid_t mypid) { - char *fn, *tfn, *p, tmp[16]; + char *fn, *tfn, *p, tmp[16], *progname; FILE *fp; pid_t pid; 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)); unlink(fn); } else { - Syslog('+', "Node %s is locked by pid %d", ascfnode(addr, 0x1f), pid); + 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); + free(progname); unlink(tfn); free(tfn); return 1;