=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/wall/ttymsg.c,v retrieving revision 1.18 retrieving revision 1.19 diff -c -r1.18 -r1.19 *** src/usr.bin/wall/ttymsg.c 2019/05/16 06:23:15 1.18 --- src/usr.bin/wall/ttymsg.c 2019/06/28 13:35:05 1.19 *************** *** 1,4 **** ! /* $OpenBSD: ttymsg.c,v 1.18 2019/05/16 06:23:15 deraadt Exp $ */ /* $NetBSD: ttymsg.c,v 1.3 1994/11/17 07:17:55 jtc Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: ttymsg.c,v 1.19 2019/06/28 13:35:05 deraadt Exp $ */ /* $NetBSD: ttymsg.c,v 1.3 1994/11/17 07:17:55 jtc Exp $ */ /* *************** *** 91,97 **** * open will fail on slip lines or exclusive-use lines * if not running as root; not an error. */ ! if ((fd = open(device, O_WRONLY|O_NONBLOCK, 0)) < 0) { if (errno == EBUSY || errno == EACCES) return (NULL); (void) snprintf(errbuf, sizeof(errbuf), --- 91,97 ---- * open will fail on slip lines or exclusive-use lines * if not running as root; not an error. */ ! if ((fd = open(device, O_WRONLY|O_NONBLOCK, 0)) == -1) { if (errno == EBUSY || errno == EACCES) return (NULL); (void) snprintf(errbuf, sizeof(errbuf), *************** *** 100,106 **** } if (getuid()) { ! if (fstat(fd, &st) < 0 || (st.st_mode & S_IWGRP) == 0) { close(fd); return (NULL); --- 100,106 ---- } if (getuid()) { ! if (fstat(fd, &st) == -1 || (st.st_mode & S_IWGRP) == 0) { close(fd); return (NULL); *************** *** 143,149 **** _exit(1); } cpid = fork(); ! if (cpid < 0) { (void) snprintf(errbuf, sizeof(errbuf), "fork: %s", strerror(errno)); (void) close(fd); --- 143,149 ---- _exit(1); } cpid = fork(); ! if (cpid == -1) { (void) snprintf(errbuf, sizeof(errbuf), "fork: %s", strerror(errno)); (void) close(fd);