]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Bug #614 Fix duplicate descriptor code and properly handle error conditions
authorDanny Mayer <mayer@ntp.org>
Mon, 15 May 2006 23:30:22 +0000 (19:30 -0400)
committerDanny Mayer <mayer@ntp.org>
Mon, 15 May 2006 23:30:22 +0000 (19:30 -0400)
bk: 44690f0eeuuqS6oG37YgmgBOTciYKw

ntpd/ntp_io.c

index 9614ddeb56e846a1c20987a3a5f4b9a46c7a0b8f..c95a7c925277202972c6dcd4708bf72df13943d1 100644 (file)
@@ -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