Commit 35be2ee2 authored by Pavel Emelyanov's avatar Pavel Emelyanov

img: Don't return fd, return -1 instead

The same -- int-fd will soon go away, so return the
explicit int -1 instead of it.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 42821edc
...@@ -1308,7 +1308,7 @@ int prepare_cgroup(void) ...@@ -1308,7 +1308,7 @@ int prepare_cgroup(void)
if (errno == ENOENT) /* backward compatibility */ if (errno == ENOENT) /* backward compatibility */
return 0; return 0;
else else
return fd; return -1;
} }
ret = pb_read_one_eof(fd, &ce, PB_CGROUP); ret = pb_read_one_eof(fd, &ce, PB_CGROUP);
......
...@@ -1984,7 +1984,7 @@ static int prepare_itimers_from_fd(int pid, struct task_restore_args *args) ...@@ -1984,7 +1984,7 @@ static int prepare_itimers_from_fd(int pid, struct task_restore_args *args)
fd = open_image(CR_FD_ITIMERS, O_RSTR, pid); fd = open_image(CR_FD_ITIMERS, O_RSTR, pid);
if (fd < 0) if (fd < 0)
return fd; return -1;
ret = pb_read_one(fd, &ie, PB_ITIMER); ret = pb_read_one(fd, &ie, PB_ITIMER);
if (ret < 0) if (ret < 0)
...@@ -2109,7 +2109,7 @@ static int prepare_posix_timers_from_fd(int pid) ...@@ -2109,7 +2109,7 @@ static int prepare_posix_timers_from_fd(int pid)
if (errno == ENOENT) /* backward compatibility */ if (errno == ENOENT) /* backward compatibility */
return 0; return 0;
else else
return fd; return -1;
} }
while (1) { while (1) {
...@@ -2178,7 +2178,7 @@ static int prepare_creds(int pid, struct task_restore_args *args) ...@@ -2178,7 +2178,7 @@ static int prepare_creds(int pid, struct task_restore_args *args)
fd = open_image(CR_FD_CREDS, O_RSTR, pid); fd = open_image(CR_FD_CREDS, O_RSTR, pid);
if (fd < 0) if (fd < 0)
return fd; return -1;
ret = pb_read_one(fd, &ce, PB_CREDS); ret = pb_read_one(fd, &ce, PB_CREDS);
close_safe(&fd); close_safe(&fd);
......
...@@ -325,7 +325,7 @@ static int read_pstree_image(void) ...@@ -325,7 +325,7 @@ static int read_pstree_image(void)
ps_fd = open_image(CR_FD_PSTREE, O_RSTR); ps_fd = open_image(CR_FD_PSTREE, O_RSTR);
if (ps_fd < 0) if (ps_fd < 0)
return ps_fd; return -1;
while (1) { while (1) {
PstreeEntry *e; PstreeEntry *e;
......
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