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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a7de35901dd94f752240cf611a8841defc888bf;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 9614ddeb56..c95a7c9252 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