#endif
static void
-remove_control_data(void *arg)
+control_remove(void *arg)
{
struct fd_list *l, *n, *last = NULL;
}
static void
-handle_control_data(void *arg)
+control_handle_data(void *arg)
{
struct fd_list *l = arg;
ssize_t bytes;
bytes = read(l->fd, buffer, sizeof(buffer) - 1);
if (bytes == -1 || bytes == 0) {
- remove_control_data(l);
+ control_remove(l);
return;
}
buffer[bytes] = '\0';
/* ARGSUSED */
static void
-handle_control(_unused void *arg)
+control_handle(_unused void *arg)
{
struct sockaddr_un run;
socklen_t len;
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);
}
}
}
int
-start_control(void)
+control_start(void)
{
int len;
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;
}
int
-open_control(void)
+control_open(void)
{
int len;
}
int
-send_control(int argc, char * const *argv)
+control_send(int argc, char * const *argv)
{
char *p = buffer;
int i;
};
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
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);
}
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);
}
} else {
if (errno != ENOENT)
- syslog(LOG_ERR, "open_control: %m");
+ syslog(LOG_ERR, "control_open: %m");
}
}
}
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) {