ANSI (real bug fix!)
[unix-history] / usr / src / usr.bin / tip / hunt.c
index 879fe3f..d4c3ce6 100644 (file)
@@ -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
  */
 
 #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"
 
 
 #include "tip.h"
 
@@ -16,9 +17,9 @@ extern char *rindex();
 static jmp_buf deadline;
 static int deadfl;
 
 static jmp_buf deadline;
 static int deadfl;
 
+void
 dead()
 {
 dead()
 {
-
        deadfl = 1;
        longjmp(deadline, 1);
 }
        deadfl = 1;
        longjmp(deadline, 1);
 }
@@ -27,16 +28,14 @@ hunt(name)
        char *name;
 {
        register char *cp;
        char *name;
 {
        register char *cp;
-       int (*f)();
+       sig_t f;
 
        f = signal(SIGALRM, dead);
        while (cp = getremote(name)) {
                deadfl = 0;
                uucplock = rindex(cp, '/')+1;
 
        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;
                        continue;
-               }
                /*
                 * Straight through call units, such as the BIZCOMP,
                 * VADIC and the DF, must indicate they're hardwired in
                /*
                 * 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);
                }
                        signal(SIGALRM, SIG_DFL);
                        return ((int)cp);
                }
-               delock(uucplock);
+               (void)uu_unlock(uucplock);
        }
        signal(SIGALRM, f);
        return (deadfl ? -1 : (int)cp);
        }
        signal(SIGALRM, f);
        return (deadfl ? -1 : (int)cp);