X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmisc%2Fopenpty.c;h=102024732d09296596eb9b857ed316fb3ffc0685;hb=507b6091fa75903ff05c21a4470b7b7cc3061d0d;hp=0b4eb221497601fd4fcc56a9f0905f12a638f95d;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/misc/openpty.c b/src/misc/openpty.c index 0b4eb221..10202473 100644 --- a/src/misc/openpty.c +++ b/src/misc/openpty.c @@ -12,7 +12,7 @@ int openpty(int *m, int *s, char *name, const struct termios *tio, const struct char buf[20]; *m = open("/dev/ptmx", O_RDWR|O_NOCTTY); - if (!*m) return -1; + if (*m < 0) return -1; if (ioctl(*m, TIOCSPTLCK, &n) || ioctl (*m, TIOCGPTN, &n)) { close(*m);