BSD 3 development
[unix-history] / usr / src / cmd / mesg.c
old mode 100644 (file)
new mode 100755 (executable)
index 3d55a36..77e8f99
@@ -21,6 +21,8 @@ char *argv[];
 {
        int r=0;
        tty = ttyname(2);
 {
        int r=0;
        tty = ttyname(2);
+       if (tty == 0)
+               exit(13);
        if(stat(tty, &sbuf) < 0) error("cannot stat");
        if(argc < 2) {
                if(sbuf.st_mode & 02)
        if(stat(tty, &sbuf) < 0) error("cannot stat");
        if(argc < 2) {
                if(sbuf.st_mode & 02)