X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/8f1963b9bd319ff5f61e0f8e2195d1d57d0a5f89..519d1c118a9db31a1d05db51e0c1529e61130b18:/usr/src/usr.bin/tip/hunt.c diff --git a/usr/src/usr.bin/tip/hunt.c b/usr/src/usr.bin/tip/hunt.c index 879fe3f772..d4c3ce6327 100644 --- a/usr/src/usr.bin/tip/hunt.c +++ b/usr/src/usr.bin/tip/hunt.c @@ -1,12 +1,13 @@ /* - * Copyright (c) 1983 Regents of the University of California. - * All rights reserved. The Berkeley software License Agreement - * specifies the terms and conditions for redistribution. + * Copyright (c) 1983 The Regents of the University of California. + * All rights reserved. + * + * %sccs.include.redist.c% */ #ifndef lint -static char sccsid[] = "@(#)hunt.c 5.2 (Berkeley) %G%"; -#endif not lint +static char sccsid[] = "@(#)hunt.c 5.6 (Berkeley) %G%"; +#endif /* not lint */ #include "tip.h" @@ -16,9 +17,9 @@ extern char *rindex(); static jmp_buf deadline; static int deadfl; +void dead() { - deadfl = 1; longjmp(deadline, 1); } @@ -27,16 +28,14 @@ hunt(name) char *name; { register char *cp; - int (*f)(); + sig_t f; f = signal(SIGALRM, dead); while (cp = getremote(name)) { deadfl = 0; uucplock = rindex(cp, '/')+1; - if (mlock(uucplock) < 0) { - delock(uucplock); + if (uu_lock(uucplock) < 0) continue; - } /* * Straight through call units, such as the BIZCOMP, * VADIC and the DF, must indicate they're hardwired in @@ -61,7 +60,7 @@ hunt(name) signal(SIGALRM, SIG_DFL); return ((int)cp); } - delock(uucplock); + (void)uu_unlock(uucplock); } signal(SIGALRM, f); return (deadfl ? -1 : (int)cp);