From: Roy Marples Date: Tue, 13 Nov 2012 10:17:19 +0000 (+0000) Subject: Use a proper namespace for control X-Git-Tag: v5.99.3~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e749a9ee95b678b1c7bc773a6182fd38cf9f756b;p=thirdparty%2Fdhcpcd.git Use a proper namespace for control --- diff --git a/control.c b/control.c index e9af1b95..9e728017 100644 --- a/control.c +++ b/control.c @@ -64,7 +64,7 @@ cleanup(void) #endif static void -remove_control_data(void *arg) +control_remove(void *arg) { struct fd_list *l, *n, *last = NULL; @@ -87,7 +87,7 @@ remove_control_data(void *arg) } static void -handle_control_data(void *arg) +control_handle_data(void *arg) { struct fd_list *l = arg; ssize_t bytes; @@ -97,7 +97,7 @@ handle_control_data(void *arg) bytes = read(l->fd, buffer, sizeof(buffer) - 1); if (bytes == -1 || bytes == 0) { - remove_control_data(l); + control_remove(l); return; } buffer[bytes] = '\0'; @@ -115,7 +115,7 @@ handle_control_data(void *arg) /* ARGSUSED */ static void -handle_control(_unused void *arg) +control_handle(_unused void *arg) { struct sockaddr_un run; socklen_t len; @@ -132,7 +132,7 @@ handle_control(_unused void *arg) l->listener = 0; l->next = control_fds; control_fds = l; - add_event(l->fd, handle_control_data, l); + add_event(l->fd, control_handle_data, l); } } @@ -148,7 +148,7 @@ make_sock(void) } int -start_control(void) +control_start(void) { int len; @@ -165,12 +165,12 @@ start_control(void) close(fd); return -1; } - add_event(fd, handle_control, NULL); + add_event(fd, control_handle, NULL); return fd; } int -stop_control(void) +control_stop(void) { int retval = 0; struct fd_list *l; @@ -195,7 +195,7 @@ stop_control(void) } int -open_control(void) +control_open(void) { int len; @@ -208,7 +208,7 @@ open_control(void) } int -send_control(int argc, char * const *argv) +control_send(int argc, char * const *argv) { char *p = buffer; int i; diff --git a/control.h b/control.h index d0e1b60c..08e858b1 100644 --- a/control.h +++ b/control.h @@ -37,9 +37,9 @@ struct fd_list { }; extern struct fd_list *control_fds; -int start_control(void); -int stop_control(void); -int open_control(void); -int send_control(int, char * const *); +int control_start(void); +int control_stop(void); +int control_open(void); +int control_send(int, char * const *); #endif diff --git a/dhcpcd.c b/dhcpcd.c index 2678edeb..360ccdae 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -201,8 +201,8 @@ cleanup(void) close(linkfd); if (pidfd > -1) { if (options & DHCPCD_MASTER) { - if (stop_control() == -1) - syslog(LOG_ERR, "stop_control: %m"); + if (control_stop() == -1) + syslog(LOG_ERR, "control_stop: %m"); } close(pidfd); unlink(pidfile); @@ -1966,11 +1966,11 @@ main(int argc, char **argv) } if (!(options & (DHCPCD_MASTER | DHCPCD_TEST))) { - control_fd = open_control(); + control_fd = control_open(); if (control_fd != -1) { syslog(LOG_INFO, "sending commands to master dhcpcd process"); - i = send_control(argc, argv); + i = control_send(argc, argv); if (i > 0) { syslog(LOG_DEBUG, "send OK"); exit(EXIT_SUCCESS); @@ -1980,7 +1980,7 @@ main(int argc, char **argv) } } else { if (errno != ENOENT) - syslog(LOG_ERR, "open_control: %m"); + syslog(LOG_ERR, "control_open: %m"); } } @@ -2070,8 +2070,8 @@ main(int argc, char **argv) } if (options & DHCPCD_MASTER) { - if (start_control() == -1) - syslog(LOG_ERR, "start_control: %m"); + if (control_start() == -1) + syslog(LOG_ERR, "control_start: %m"); } if (init_sockets() == -1) {