|
|
61d8f4 |
diff -up ksh-20120801/src/cmd/ksh93/sh/io.c.fdstatus ksh-20120801/src/cmd/ksh93/sh/io.c
|
|
|
61d8f4 |
--- ksh-20120801/src/cmd/ksh93/sh/io.c.fdstatus 2013-07-04 18:01:27.187516655 +0200
|
|
|
61d8f4 |
+++ ksh-20120801/src/cmd/ksh93/sh/io.c 2013-07-04 18:01:38.249607392 +0200
|
|
|
61d8f4 |
@@ -1508,7 +1508,7 @@ int sh_redirect(Shell_t *shp,struct iono
|
|
|
61d8f4 |
fn = fd;
|
|
|
61d8f4 |
if(fd<10)
|
|
|
61d8f4 |
{
|
|
|
61d8f4 |
- if((fn=fcntl(fd,F_DUPFD,10)) < 0)
|
|
|
61d8f4 |
+ if((fn=sh_fcntl(fd,F_DUPFD,10)) < 0)
|
|
|
61d8f4 |
goto fail;
|
|
|
61d8f4 |
if(fn>=shp->gd->lim.open_max && !sh_iovalidfd(shp,fn))
|
|
|
61d8f4 |
goto fail;
|
|
|
61d8f4 |
diff -up ksh-20120801/src/cmd/ksh93/sh/subshell.c.fdstatus ksh-20120801/src/cmd/ksh93/sh/subshell.c
|
|
|
61d8f4 |
--- ksh-20120801/src/cmd/ksh93/sh/subshell.c.fdstatus 2012-07-17 23:54:21.000000000 +0200
|
|
|
61d8f4 |
+++ ksh-20120801/src/cmd/ksh93/sh/subshell.c 2013-07-04 17:56:20.342000310 +0200
|
|
|
61d8f4 |
@@ -122,7 +122,7 @@ void sh_subtmpfile(Shell_t *shp)
|
|
|
61d8f4 |
register struct checkpt *pp = (struct checkpt*)shp->jmplist;
|
|
|
61d8f4 |
register struct subshell *sp = subshell_data->pipe;
|
|
|
61d8f4 |
/* save file descriptor 1 if open */
|
|
|
61d8f4 |
- if((sp->tmpfd = fd = fcntl(1,F_DUPFD,10)) >= 0)
|
|
|
61d8f4 |
+ if((sp->tmpfd = fd = sh_fcntl(1,F_DUPFD,10)) >= 0)
|
|
|
61d8f4 |
{
|
|
|
61d8f4 |
fcntl(fd,F_SETFD,FD_CLOEXEC);
|
|
|
61d8f4 |
shp->fdstatus[fd] = shp->fdstatus[1]|IOCLEX;
|
|
|
61d8f4 |
@@ -554,7 +554,7 @@ Sfio_t *sh_subshell(Shell_t *shp,Shnode_
|
|
|
61d8f4 |
sp->pwdfd = n;
|
|
|
61d8f4 |
if(n<10)
|
|
|
61d8f4 |
{
|
|
|
61d8f4 |
- sp->pwdfd = fcntl(n,F_DUPFD,10);
|
|
|
61d8f4 |
+ sp->pwdfd = sh_fcntl(n,F_DUPFD,10);
|
|
|
61d8f4 |
close(n);
|
|
|
61d8f4 |
}
|
|
|
61d8f4 |
if(sp->pwdfd>0)
|
|
|
61d8f4 |
diff -up ksh-20120801/src/cmd/ksh93/sh/xec.c.fdstatus ksh-20120801/src/cmd/ksh93/sh/xec.c
|
|
|
61d8f4 |
--- ksh-20120801/src/cmd/ksh93/sh/xec.c.fdstatus 2012-07-23 16:49:32.000000000 +0200
|
|
|
61d8f4 |
+++ ksh-20120801/src/cmd/ksh93/sh/xec.c 2013-07-04 17:57:47.153712116 +0200
|
|
|
61d8f4 |
@@ -116,7 +116,7 @@ static int iousepipe(Shell_t *shp)
|
|
|
61d8f4 |
return(0);
|
|
|
61d8f4 |
usepipe++;
|
|
|
61d8f4 |
fcntl(subpipe[0],F_SETFD,FD_CLOEXEC);
|
|
|
61d8f4 |
- subpipe[2] = fcntl(1,F_DUPFD,10);
|
|
|
61d8f4 |
+ subpipe[2] = sh_fcntl(1,F_DUPFD,10);
|
|
|
61d8f4 |
fcntl(subpipe[2],F_SETFD,FD_CLOEXEC);
|
|
|
61d8f4 |
shp->fdstatus[subpipe[2]] = shp->fdstatus[1];
|
|
|
61d8f4 |
close(1);
|
|
|
61d8f4 |
@@ -3622,7 +3622,7 @@ static void coproc_init(Shell_t *shp, in
|
|
|
61d8f4 |
sh_pipe(shp->cpipe);
|
|
|
61d8f4 |
if((outfd=shp->cpipe[1]) < 10)
|
|
|
61d8f4 |
{
|
|
|
61d8f4 |
- int fd=fcntl(shp->cpipe[1],F_DUPFD,10);
|
|
|
61d8f4 |
+ int fd=sh_fcntl(shp->cpipe[1],F_DUPFD,10);
|
|
|
61d8f4 |
if(fd>=10)
|
|
|
61d8f4 |
{
|
|
|
61d8f4 |
shp->fdstatus[fd] = (shp->fdstatus[outfd]&~IOCLEX);
|