diff options
author | brian <brian@FreeBSD.org> | 1997-03-31 22:51:00 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-03-31 22:51:00 +0000 |
commit | cb7f5ad55578fad7245152f0f9b7647830a53a2b (patch) | |
tree | 2c78d1ecaf1cdd58a514ff6e9ba36cc4bc7becdf /usr.bin/tip | |
parent | 8871c2899e1277da4a3d19c3cbbc4d2fae060306 (diff) | |
download | FreeBSD-src-cb7f5ad55578fad7245152f0f9b7647830a53a2b.zip FreeBSD-src-cb7f5ad55578fad7245152f0f9b7647830a53a2b.tar.gz |
Remove the syslog stuff, and allow various return values
in uu_lock(). Add uu_lockerr() for turning the results of
uu_lock into something printable. Remove bogus section in man page
about race conditions allowing both processes to get the lock.
Include libutil.h and use uu_lock() correctly where it should.
Suggested by: ache@freebsd.org
Diffstat (limited to 'usr.bin/tip')
-rw-r--r-- | usr.bin/tip/tip/Makefile | 1 | ||||
-rw-r--r-- | usr.bin/tip/tip/hunt.c | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/tip/tip/Makefile b/usr.bin/tip/tip/Makefile index 073a0e4..ec9aee1 100644 --- a/usr.bin/tip/tip/Makefile +++ b/usr.bin/tip/tip/Makefile @@ -14,7 +14,6 @@ LIBACU=${.CURDIR}/../libacu/libacu.a .endif PROG= tip -CFLAGS+=-DUSE_PERROR DPADD= $(LIBACU) LDADD= $(LIBACU) -lutil LINKS= ${BINDIR}/tip diff --git a/usr.bin/tip/tip/hunt.c b/usr.bin/tip/tip/hunt.c index 97e3a6a..e99e73b 100644 --- a/usr.bin/tip/tip/hunt.c +++ b/usr.bin/tip/tip/hunt.c @@ -35,6 +35,7 @@ static char sccsid[] = "@(#)hunt.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ +#include <libutil.h> #include "tipconf.h" #include "tip.h" @@ -56,13 +57,17 @@ hunt(name) { register char *cp; sig_t f; + int res; f = signal(SIGALRM, dead); while (cp = getremote(name)) { deadfl = 0; uucplock = rindex(cp, '/')+1; - if (uu_lock(uucplock) < 0) + if ((res = uu_lock(uucplock)) != UU_LOCK_OK) { + if (res != UU_LOCK_INUSE) + fprintf(stderr, "uu_lock: %s\n", uu_lockerr(res)); continue; + } /* * Straight through call units, such as the BIZCOMP, * VADIC and the DF, must indicate they're hardwired in |