diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-07-16 11:25:02 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-07-16 11:25:02 +0000 |
commit | dfb079ccdc91a516d29729748913e1db461e83a1 (patch) | |
tree | 54b62fc6db3122b1e11fa69a7e18fdf79af3b9eb | |
parent | ef91f7b78af34a28049dd5ec955de0f389799087 (diff) | |
download | execline-dfb079ccdc91a516d29729748913e1db461e83a1.tar.gz execline-dfb079ccdc91a516d29729748913e1db461e83a1.tar.xz execline-dfb079ccdc91a516d29729748913e1db461e83a1.zip |
Propagate fd_close() changes
-rw-r--r-- | src/execline/execlineb.c | 4 | ||||
-rw-r--r-- | src/execline/redirfd.c | 3 |
2 files changed, 0 insertions, 7 deletions
diff --git a/src/execline/execlineb.c b/src/execline/execlineb.c index 64b168d..f94da6e 100644 --- a/src/execline/execlineb.c +++ b/src/execline/execlineb.c @@ -1,7 +1,6 @@ /* ISC license. */ #include <string.h> -#include <errno.h> #include <skalibs/types.h> #include <skalibs/allreadwrite.h> #include <skalibs/sgetopt.h> @@ -108,16 +107,13 @@ int main (int argc, char const *const *argv, char const *const *envp) char buf[BUFFER_INSIZE] ; buffer b ; int fd ; - int e ; if (!argc--) strerr_dieusage(100, USAGE) ; dollar0 = *argv++ ; fd = open_readb(dollar0) ; if (fd < 0) strerr_diefu3sys(111, "open ", dollar0, " for reading") ; buffer_init(&b, &fd_readv, fd, buf, BUFFER_INSIZE) ; nc = el_parse_from_buffer(&sa, &b) ; - e = errno ; fd_close(fd) ; - errno = e ; } switch (nc) diff --git a/src/execline/redirfd.c b/src/execline/redirfd.c index 1539946..93e1582 100644 --- a/src/execline/redirfd.c +++ b/src/execline/redirfd.c @@ -44,13 +44,10 @@ int main (int argc, char const *const *argv, char const *const *envp) fd2 = open3(argv[1], flags, 0666) ; if ((fd2 == -1) && (what == O_WRONLY) && (errno == ENXIO)) { - int e ; int fdr = open_read(argv[1]) ; if (fdr == -1) strerr_diefu2sys(111, "open_read ", argv[1]) ; fd2 = open3(argv[1], flags, 0666) ; - e = errno ; fd_close(fdr) ; - errno = e ; } if (fd2 == -1) strerr_diefu2sys(111, "open ", argv[1]) ; if (fd_move(fd, fd2) == -1) |