Skip to content

Commit

Permalink
lxc init: coding style
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <[email protected]>
  • Loading branch information
Christian Brauner committed Apr 9, 2018
1 parent 7426904 commit d6d727a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lxc/cmd/lxc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ static struct arguments my_args = {
static void prevent_forking(void)
{
FILE *f;
int fd = -1;
size_t len = 0;
char *line = NULL;
char path[MAXPATHLEN];
Expand All @@ -110,7 +109,7 @@ static void prevent_forking(void)
return;

while (getline(&line, &len, f) != -1) {
int ret;
int fd, ret;
char *p, *p2;

p = strchr(line, ':');
Expand Down Expand Up @@ -146,7 +145,8 @@ static void prevent_forking(void)
goto on_error;
}

if (write(fd, "1", 1) != 1)
ret = write(fd, "1", 1);
if (ret != 1)
SYSERROR("Failed to write to \"%s\"", path);

close(fd);
Expand Down

0 comments on commit d6d727a

Please sign in to comment.