fixed order of tgoto args, zapped reliance on former isprint bug
[unix-history] / usr / src / usr.bin / tip / hunt.c
index 3e56b29..833c3e2 100644 (file)
@@ -1,12 +1,23 @@
 /*
 /*
- * 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.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)hunt.c     5.1 (Berkeley) %G%";
-#endif not lint
+static char sccsid[] = "@(#)hunt.c     5.4 (Berkeley) %G%";
+#endif /* not lint */
 
 #include "tip.h"
 
 
 #include "tip.h"
 
@@ -30,13 +41,11 @@ hunt(name)
        int (*f)();
 
        f = signal(SIGALRM, dead);
        int (*f)();
 
        f = signal(SIGALRM, dead);
-       deadfl = 0;
        while (cp = getremote(name)) {
        while (cp = getremote(name)) {
+               deadfl = 0;
                uucplock = rindex(cp, '/')+1;
                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 +70,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);