Unverified Commit 7a8e91c1 by Christian Brauner Committed by GitHub

Merge pull request #2534 from tcharding/checkpatch

Checkpatch
parents c5aca615 f0a86c6d
......@@ -54,7 +54,7 @@
lxc_log_define(lxc_init, lxc);
static sig_atomic_t was_interrupted = 0;
static sig_atomic_t was_interrupted;
static void interrupt_handler(int sig)
{
......@@ -556,7 +556,7 @@ static int arguments_parse(struct arguments *args, int argc,
/* Check the command options */
if (!args->name) {
if(!args->quiet)
if (!args->quiet)
fprintf(stderr, "lxc-init: missing container name, use --name option\n");
return -1;
}
......
......@@ -130,7 +130,8 @@ static int lxc_monitord_fifo_delete(struct lxc_monitor *mon)
return 0;
}
static void lxc_monitord_sockfd_remove(struct lxc_monitor *mon, int fd) {
static void lxc_monitord_sockfd_remove(struct lxc_monitor *mon, int fd)
{
int i;
if (lxc_mainloop_del_handler(&mon->descr, fd))
......@@ -175,7 +176,7 @@ static int lxc_monitord_sock_handler(int fd, uint32_t events, void *data,
static int lxc_monitord_sock_accept(int fd, uint32_t events, void *data,
struct lxc_epoll_descr *descr)
{
int ret,clientfd;
int ret, clientfd;
struct lxc_monitor *mon = data;
struct ucred cred;
socklen_t credsz = sizeof(cred);
......@@ -301,7 +302,7 @@ static void lxc_monitord_delete(struct lxc_monitor *mon)
static int lxc_monitord_fifo_handler(int fd, uint32_t events, void *data,
struct lxc_epoll_descr *descr)
{
int ret,i;
int ret, i;
struct lxc_msg msglxc;
struct lxc_monitor *mon = data;
......@@ -371,7 +372,7 @@ int main(int argc, char *argv[])
}
ret = snprintf(logpath, sizeof(logpath), "%s/lxc-monitord.log",
(strcmp(LXCPATH, lxcpath) ? lxcpath : LOGPATH ));
(strcmp(LXCPATH, lxcpath) ? lxcpath : LOGPATH));
if (ret < 0 || ret >= sizeof(logpath))
exit(EXIT_FAILURE);
......
......@@ -364,9 +364,8 @@ int main(int argc, char *argv[])
perror("pipe");
exit(EXIT_FAILURE);
}
if ((pid = fork()) == 0) {
/* Child. */
pid = fork();
if (pid == 0) { /* Child. */
close(pipe_fds1[0]);
close(pipe_fds2[1]);
opentty(ttyname0, 0);
......@@ -395,7 +394,7 @@ int main(int argc, char *argv[])
close(pipe_fds1[1]);
close(pipe_fds2[0]);
return do_child((void*)argv);
return do_child((void *)argv);
}
close(pipe_fds1[1]);
......@@ -418,8 +417,8 @@ int main(int argc, char *argv[])
perror("write to pipe");
exit(EXIT_FAILURE);
}
if ((ret = waitpid(pid, &status, __WALL)) < 0) {
ret = waitpid(pid, &status, __WALL);
if (ret < 0) {
printf("waitpid() returns %d, errno %d\n", ret, errno);
exit(EXIT_FAILURE);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment