#define CKUTIO_C
#ifdef aegis
-char *ckxv = "Aegis Communications support, 9.0.323, 10 June 2011";
+char *ckxv = "Aegis Communications support, 9.0.326, 20 August 2011";
#else
#ifdef Plan9
-char *ckxv = "Plan 9 Communications support, 9.0.323, 10 June 2011";
+char *ckxv = "Plan 9 Communications support, 9.0.326, 20 August 2011";
#else
-char *ckxv = "UNIX Communications support, 9.0.323, 10 June 2011";
+char *ckxv = "UNIX Communications support, 9.0.326, 20 August 2011";
#endif /* Plan9 */
#endif /* aegis */
#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
#endif /* XENIX */
#ifdef CK_SCOV5 /* Ditto for SCO OpenServer 5.0 */
+#ifndef SCO_OSR507 /* 299 */
#ifdef FIONREAD
#undef FIONREAD
#endif /* FIONREAD */
-#endif /* XENIX */
+#endif /* SCO_OSR507 */
+#endif /* CK_SCOV5 */
+
+#ifdef SCO_OSR507 /* 299 */
+#ifdef RDCHK
+#undef RDCHK
+#endif /* RDCHK */
+#endif /* SCO_OSR507 */
/* Whether to include <fcntl.h> */
int x, n;
int islink = 0;
+#ifdef __FreeBSD__
+ char *devname;
+#endif /* __FreeBSD__ */
#ifdef NOUUCP
debug(F100,"ttlock NOUUCP","",0);
#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);
/*
ckitoa(n));
debug(F100,msgbuf,"",0);
#else
+#ifdef RDCHK
n = rdchk(fd);
debug(F101,"pty_chk rdchk","",n);
-#ifdef RDCHK
+#else
+ n = 1;
#endif /* RDCHK */
#endif /* FIONREAD */
return((n > -1) ? n : 0);