From: Danny Mayer Date: Mon, 15 May 2006 23:30:22 +0000 (-0400) Subject: Bug #614 Fix duplicate descriptor code and properly handle error conditions X-Git-Tag: NTP_4_2_1P253_RC~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c170d7faa8f6f7084442acfe5b0d2c0efe4dae3;p=thirdparty%2Fntp.git Bug #614 Fix duplicate descriptor code and properly handle error conditions bk: 44690f0eeuuqS6oG37YgmgBOTciYKw --- diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index 9614ddeb5..c95a7c925 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -257,11 +257,16 @@ static int dup_fd(int fd) tmp = errno; if (newfd == -1) - perror("fcntl"); + { + msyslog(LOG_ERR, "Error duplicating file descriptor: %m"); + return (fd); + } (void)close(fd); errno = tmp; return (newfd); } + else + return (fd); } #endif