Just in case a real dup*() or fcntl() doesn't return -1 on error, but
something like -2.
DLSYM_FUNCTION(real_dup, "dup");
newfd = real_dup(oldfd);
- if (newfd != -1) {
+ if (newfd > -1) {
dup_fd(oldfd, newfd);
}
DLSYM_FUNCTION(real_dup2, "dup2");
newfd = real_dup2(oldfd, newfd);
- if (newfd != -1) {
+ if (newfd > -1) {
dup_fd(oldfd, newfd);
}
DLSYM_FUNCTION(real_dup3, "dup3");
newfd = real_dup3(oldfd, newfd, flags);
- if (newfd != -1) {
+ if (newfd > -1) {
dup_fd(oldfd, newfd);
}
va_end(ap);
/* We only care about duping fds. */
- if (cmd == F_DUPFD && result != -1) {
+ if (cmd == F_DUPFD && result > -1) {
dup_fd(fd, result);
}