libc_noux: return the new file descriptor in 'dup2()'

Fixes #369.
This commit is contained in:
Christian Prochaska 2012-09-26 13:47:46 +02:00 committed by Norman Feske
parent 0a12e262ce
commit d4499cba41

View File

@ -972,7 +972,7 @@ namespace {
return -1; return -1;
} }
return 0; return noux_fd(new_fd->context);
} }
@ -1034,7 +1034,7 @@ namespace {
* Use new allocated number as name of file descriptor * Use new allocated number as name of file descriptor
* duplicate. * duplicate.
*/ */
if (dup2(fd, new_fd)) { if (dup2(fd, new_fd) == -1) {
PERR("Plugin::fcntl: dup2 unexpectedly failed"); PERR("Plugin::fcntl: dup2 unexpectedly failed");
errno = EINVAL; errno = EINVAL;
return -1; return -1;