diff -Nur l/check_tmp.c p/check_tmp.c --- l/check_tmp.c 2015-10-29 23:38:55.281719868 -0400 +++ p/check_tmp.c 2015-10-31 15:36:48.977815179 -0400 @@ -3,6 +3,7 @@ tmp droppings following links, etc. etc. .mudge 8.20.98 */ #include "check_tmp.h" +#include void usage(char *progname); struct listStruct *addnode(struct listStruct *, char *, char *); @@ -130,7 +131,7 @@ /* steup the first element of the list */ while ((dp = readdir(dirp)) != NULL){ - if (!list) /* first time */ + if (!list) /* first time */ { if (copyflag){ if ( strncmp(dp->d_name, copyname, strlen(copyname)) == 0) { strncpy(tmp1, watchdir, MAXNAMLEN - 1); @@ -145,6 +146,7 @@ } } } + } else if (regcopyflag){ #if defined (REGEXPR_3G) if(advance(dp->d_name, expbuf)){ diff -Nur l/check_tmp.h p/check_tmp.h --- l/check_tmp.h 1998-12-24 10:40:13.000000000 -0500 +++ p/check_tmp.h 2015-10-31 15:38:32.029815834 -0400 @@ -11,6 +11,8 @@ #include #include #include +#include +#include #if defined (REGEXPR_3G) #include diff -Nur l/daemon.c p/daemon.c --- l/daemon.c 1998-12-17 15:30:41.000000000 -0500 +++ p/daemon.c 2015-10-31 15:43:22.993817681 -0400 @@ -4,6 +4,7 @@ int become_daemon(void){ pid_t pid; + int ret; if ( (pid = fork()) < 0) return(-1); @@ -20,7 +21,8 @@ else if (pid != 0) exit(0); /* death to the parental unit */ - chdir("/"); + ret = chdir("/"); + if (ret == -1) exit(0); umask(0); return(0); } diff -Nur l/list_utils.c p/list_utils.c --- l/list_utils.c 2015-10-30 08:25:54.909472807 -0400 +++ p/list_utils.c 2015-10-31 15:32:02.241813358 -0400 @@ -1,4 +1,6 @@ #include "check_tmp.h" +#include +#include static void printnode(struct listStruct *, int); static void getfilemodes(struct stat *, char *); @@ -298,6 +300,11 @@ #if defined (SOLARIS) else if (S_ISDOOR(mode)) holder[0] = 'p'; +#else +#if defined (BSD) + else if (S_ISWHT(mode)) + holder[0] = '%'; +#endif #endif else holder[0] = '?'; diff -Nur l/Makefile p/Makefile --- l/Makefile 2015-10-30 08:24:55.081473274 -0400 +++ p/Makefile 2015-10-31 15:40:18.209816508 -0400 @@ -63,7 +63,7 @@ generic: make -e $(ALL) $(MFLAGS) \ - XFLAGS='-DREGEX -DREGCOMP_3C' CC="gcc $(CFLAGS)" STATIC=-static + XFLAGS='-DREGEX -DREGCOMP_3C' CC="gcc $(CFLAGS)" #LIBS=-lgen