open distinguishes between >=0 and ==-1 but <-1 is undef, make it error
This commit is contained in:
6
misc.c
6
misc.c
@ -30,7 +30,7 @@
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.200 2012/10/22 20:52:47 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.201 2012/11/30 17:34:46 tg Exp $");
|
||||||
|
|
||||||
#define KSH_CHVT_FLAG
|
#define KSH_CHVT_FLAG
|
||||||
#ifdef MKSH_SMALL
|
#ifdef MKSH_SMALL
|
||||||
@ -1938,9 +1938,9 @@ chvt(const char *fn)
|
|||||||
"new shell is potentially insecure, can't revoke",
|
"new shell is potentially insecure, can't revoke",
|
||||||
fn);
|
fn);
|
||||||
}
|
}
|
||||||
if ((fd = open(fn, O_RDWR)) == -1) {
|
if ((fd = open(fn, O_RDWR)) < 0) {
|
||||||
sleep(1);
|
sleep(1);
|
||||||
if ((fd = open(fn, O_RDWR)) == -1)
|
if ((fd = open(fn, O_RDWR)) < 0)
|
||||||
errorf("%s: %s %s", "chvt", "can't open", fn);
|
errorf("%s: %s %s", "chvt", "can't open", fn);
|
||||||
}
|
}
|
||||||
switch (fork()) {
|
switch (fork()) {
|
||||||
|
Reference in New Issue
Block a user