]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Use a proper namespace for control
authorRoy Marples <roy@marples.name>
Tue, 13 Nov 2012 10:17:19 +0000 (10:17 +0000)
committerRoy Marples <roy@marples.name>
Tue, 13 Nov 2012 10:17:19 +0000 (10:17 +0000)
control.c
control.h
dhcpcd.c

index e9af1b9552f2e1111feae36e0cb80ff3b3a3a809..9e728017b10bbefef6c041e4d791d52458dfd786 100644 (file)
--- 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;
index d0e1b60c5c6efa97fff3909b9ab181d79eb9dd03..08e858b1b28bbb54d307eb92d6bdaad7ee9708fa 100644 (file)
--- 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
index 2678edebbf889c4f2f61d26bfa12c71cf7d38598..360ccdae7e90682e1bfcb77fe604265837abbcb8 100644 (file)
--- 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) {