+#ifdef UNIX
+#ifdef NOUUCP
+ { /* 2009/10/20 */
+ /* Allow tty devices to opened as output files */
+ int fd, istty = 0, mode = 0;
+ debug(F110,"zchko attempting to open",name,0);
+ /* Don't block on lack of Carrier or other modem signals */
+#ifdef O_NONBLOCK
+ mode = O_NONBLOCK;
+#else
+#ifdef O_NDELAY
+ mode = O_NDELAY;
+#else
+#ifdef FNDELAY
+ mode = FNDELAY;
+#endif /* FNDELAY */
+#endif /* O_NDELAY */
+#endif /* O_NONBLOCK */
+ debug(F111,"zchko open mode",name,mode);
+ fd = open(name,O_WRONLY,mode); /* Must attempt to open it */
+ debug(F111,"zchko open",name,fd);
+ if (fd > -1) { /* to get a file descriptor */
+ if (isatty(fd)) /* for isatty() */
+ istty++;
+ debug(F111,"zchko isatty",name,istty);
+ fd = close(fd);
+ if (istty) {
+ goto doaccess;
+ }
+ } else {
+ debug(F101,"zchko open errno","",errno);
+ x = -1;
+ }
+ }
+#endif /* NOUUCP */
+#endif /* UNIX */