From: Amitay Isaacs Date: Fri, 27 May 2016 03:32:28 +0000 (+1000) Subject: ctdb-system: Remove duplicate functions X-Git-Tag: tdb-1.3.10~907 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d3c15232bf7bf337127414d0c0cc639cc290710;p=thirdparty%2Fsamba.git ctdb-system: Remove duplicate functions Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- diff --git a/ctdb/common/system.h b/ctdb/common/system.h index 2b469dc1fee..2007814ce3b 100644 --- a/ctdb/common/system.h +++ b/ctdb/common/system.h @@ -47,8 +47,6 @@ int ctdb_get_peer_pid(const int fd, pid_t *peer_pid); bool set_scheduler(void); void reset_scheduler(void); -void set_nonblocking(int fd); -void set_close_on_exec(int fd); bool parse_ipv4(const char *s, unsigned port, struct sockaddr_in *sin); bool parse_ip(const char *addr, const char *ifaces, unsigned port, diff --git a/ctdb/common/system_util.c b/ctdb/common/system_util.c index 4d56fd3d853..91bd72eecbd 100644 --- a/ctdb/common/system_util.c +++ b/ctdb/common/system_util.c @@ -120,39 +120,6 @@ void reset_scheduler(void) #endif } -void set_nonblocking(int fd) -{ - int v; - - v = fcntl(fd, F_GETFL, 0); - if (v == -1) { - DEBUG(DEBUG_WARNING, ("Failed to get file status flags - %s\n", - strerror(errno))); - return; - } - if (fcntl(fd, F_SETFL, v | O_NONBLOCK) == -1) { - DEBUG(DEBUG_WARNING, ("Failed to set non_blocking on fd - %s\n", - strerror(errno))); - } -} - -void set_close_on_exec(int fd) -{ - int v; - - v = fcntl(fd, F_GETFD, 0); - if (v == -1) { - DEBUG(DEBUG_WARNING, ("Failed to get file descriptor flags - %s\n", - strerror(errno))); - return; - } - if (fcntl(fd, F_SETFD, v | FD_CLOEXEC) != 0) { - DEBUG(DEBUG_WARNING, ("Failed to set close_on_exec on fd - %s\n", - strerror(errno))); - } -} - - bool parse_ipv4(const char *s, unsigned port, struct sockaddr_in *sin) { sin->sin_family = AF_INET;