Use a proper namespace for control

This commit is contained in:
Roy Marples 2012-11-13 10:17:19 +00:00
parent b7fdc6ed45
commit e749a9ee95
3 changed files with 21 additions and 21 deletions

View File

@ -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;

View File

@ -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

View File

@ -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) {