diff -NU3 src.orig/svscan.c src/svscan.c --- src.orig/svscan.c Thu Jul 12 18:49:49 2001 +++ src/svscan.c Sun Sep 9 00:31:25 2001 @@ -11,6 +11,8 @@ #include "str.h" #include "byte.h" #include "pathexec.h" +#include "open.h" +#include "lock.h" #define SERVICES 1000 @@ -192,10 +194,17 @@ int main(int argc,char **argv) { + int fd; if (argv[0] && argv[1]) if (chdir(argv[1]) == -1) strerr_die4sys(111,FATAL,"unable to chdir to ",argv[1],": "); + fd = open_append(".svscan-lock"); + if (fd == -1) + strerr_die2sys(111,FATAL,"unable to open lock file: "); + if (lock_exnb(fd) == -1) + strerr_die2sys(111,FATAL,"unable to get lock: "); + coe(fd); for (;;) { doit(); sleep(5);