add a few generic fixes from mksh-os2
From: KO Myung-Hun <komh@chollian.net>
This commit is contained in:
7
Build.sh
7
Build.sh
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.682 2015/07/09 19:04:28 tg Exp $'
|
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.683 2015/07/09 19:19:09 tg Exp $'
|
||||||
#-
|
#-
|
||||||
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||||
# 2011, 2012, 2013, 2014, 2015
|
# 2011, 2012, 2013, 2014, 2015
|
||||||
@ -314,6 +314,7 @@ ac_testnnd() {
|
|||||||
vv ']' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN conftest.c $LIBS $ccpr"
|
vv ']' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN conftest.c $LIBS $ccpr"
|
||||||
test $tcfn = no && test -f a.out && tcfn=a.out
|
test $tcfn = no && test -f a.out && tcfn=a.out
|
||||||
test $tcfn = no && test -f a.exe && tcfn=a.exe
|
test $tcfn = no && test -f a.exe && tcfn=a.exe
|
||||||
|
test $tcfn = no && test -f conftest.exe && tcfn=conftest.exe
|
||||||
test $tcfn = no && test -f conftest && tcfn=conftest
|
test $tcfn = no && test -f conftest && tcfn=conftest
|
||||||
if test -f $tcfn; then
|
if test -f $tcfn; then
|
||||||
test 1 = $fr || fv=1
|
test 1 = $fr || fv=1
|
||||||
@ -2340,8 +2341,8 @@ files=
|
|||||||
objs=
|
objs=
|
||||||
sp=
|
sp=
|
||||||
case $tcfn in
|
case $tcfn in
|
||||||
a.exe) mkshexe=$tfn.exe ;;
|
a.exe|conftest.exe) mkshexe=$tfn.exe ;;
|
||||||
*) mkshexe=$tfn ;;
|
*) mkshexe=$tfn ;;
|
||||||
esac
|
esac
|
||||||
case $curdir in
|
case $curdir in
|
||||||
*\ *) mkshshebang="#!./$mkshexe" ;;
|
*\ *) mkshshebang="#!./$mkshexe" ;;
|
||||||
|
4
main.c
4
main.c
@ -34,7 +34,7 @@
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.295 2015/07/06 17:48:34 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.296 2015/07/09 19:19:10 tg Exp $");
|
||||||
|
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
|
|
||||||
@ -1404,7 +1404,7 @@ savefd(int fd)
|
|||||||
int nfd = fd;
|
int nfd = fd;
|
||||||
|
|
||||||
if (fd < FDBASE && (nfd = fcntl(fd, F_DUPFD, FDBASE)) < 0 &&
|
if (fd < FDBASE && (nfd = fcntl(fd, F_DUPFD, FDBASE)) < 0 &&
|
||||||
errno == EBADF)
|
(errno == EBADF || errno == EPERM))
|
||||||
return (-1);
|
return (-1);
|
||||||
if (nfd < 0 || nfd > SHRT_MAX)
|
if (nfd < 0 || nfd > SHRT_MAX)
|
||||||
errorf("too many files open in shell");
|
errorf("too many files open in shell");
|
||||||
|
Reference in New Issue
Block a user