X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Fwall-notify.c;h=bd1e8ad0112705b69355a882cf51f7cba2c510dc;hb=7b96775207895be63fb280ab147e4e9923c7bb26;hp=ab1c868fdfa18245e03b38a716b02931c1e15643;hpb=034afb1ec2f0079a0880a19871548b3f220b1d98;p=wall-notify%2Fwall-notify.git diff --git a/src/wall-notify.c b/src/wall-notify.c index ab1c868..bd1e8ad 100644 --- a/src/wall-notify.c +++ b/src/wall-notify.c @@ -82,13 +82,13 @@ static int open_tty(int public) { /* Prevent write access for other users so they can't use wall to send * messages to this program. */ if (!public) { - name = ptsname(ptm); - if (!name) { - return -1; - } - if (chmod(name, S_IRUSR | S_IWUSR) != 0) { - return -1; - } + name = ptsname(ptm); + if (!name) { + return -1; + } + if (chmod(name, S_IRUSR | S_IWUSR) != 0) { + return -1; + } } if (unlockpt(ptm) != 0) { @@ -399,6 +399,7 @@ int main(int argc, char **argv) { break; case 'm': mesg_yes = 1; + break; case 'h': usage(argv[0]); break;