Imported Upstream version 302
[ckermit.git] / ckutio.c
index 6551e77..05564de 100644 (file)
--- a/ckutio.c
+++ b/ckutio.c
@@ -1,12 +1,12 @@
 #define CKUTIO_C
 
 #ifdef aegis
-char *ckxv = "Aegis Communications support, 9.0.324, 20 June 2011";
+char *ckxv = "Aegis Communications support, 9.0.326, 20 August 2011";
 #else
 #ifdef Plan9
-char *ckxv = "Plan 9 Communications support, 9.0.324, 20 June 2011";
+char *ckxv = "Plan 9 Communications support, 9.0.326, 20 August 2011";
 #else
-char *ckxv = "UNIX Communications support, 9.0.324, 20 June 2011";
+char *ckxv = "UNIX Communications support, 9.0.326, 20 August 2011";
 #endif /* Plan9 */
 #endif /* aegis */
 
@@ -50,7 +50,13 @@ extern int duplex;
 #endif /* CK_ANSIC */
 #endif /* OSF13 */
 
-#include <errno.h>                     /* System error numbers */
+#ifndef HPUXPRE65
+#include <errno.h>                     /* Error number symbols */
+#else
+#ifndef ERRNO_INCLUDED
+#include <errno.h>                     /* Error number symbols */
+#endif /* ERRNO_INCLUDED */
+#endif /* HPUXPRE65 */
 
 #ifdef __386BSD__
 #define ENOTCONN 57
@@ -4970,6 +4976,9 @@ ttlock(ttdev) char *ttdev; {
 
     int x, n;
     int islink = 0;
+#ifdef __FreeBSD__
+    char *devname;
+#endif /* __FreeBSD__ */
 
 #ifdef NOUUCP
     debug(F100,"ttlock NOUUCP","",0);
@@ -4981,8 +4990,17 @@ ttlock(ttdev) char *ttdev; {
 #ifdef USETTYLOCK
     haslock = 0;                        /* Not locked yet. */
     *flfnam = '\0';                    /* Lockfile name is empty. */
+#ifdef __FreeBSD__
+    if ((devname = xxlast(ttdev,'/')) != NULL)
+#ifdef FREEBSD8
+      ckstrncat(lockname,devname+1,DEVNAMLEN-ckstrncpy(lockname,"pts",4));
+#else
+      ckstrncpy(lockname,devname+1,DEVNAMLEN);
+#endif /* FREEBSD8 */
+#else
     if (!strncmp(ttdev,"/dev/",5) && ttdev[5])
       ckstrncpy(lockname,ttdev+5,DEVNAMLEN);
+#endif /* __FreeBSD__ */
     else
       ckstrncpy(lockname,ttdev,DEVNAMLEN);
 /*