conf: remove tautological check

parent 961b6f44
...@@ -1494,7 +1494,8 @@ int lxc_chroot(const struct lxc_rootfs *rootfs) ...@@ -1494,7 +1494,8 @@ int lxc_chroot(const struct lxc_rootfs *rootfs)
*/ */
static int lxc_pivot_root(const char *rootfs) static int lxc_pivot_root(const char *rootfs)
{ {
int newroot = -1, oldroot = -1, ret = -1; int oldroot;
int newroot = -1, ret = -1;
oldroot = open("/", O_DIRECTORY | O_RDONLY); oldroot = open("/", O_DIRECTORY | O_RDONLY);
if (oldroot < 0) { if (oldroot < 0) {
...@@ -1564,9 +1565,9 @@ static int lxc_pivot_root(const char *rootfs) ...@@ -1564,9 +1565,9 @@ static int lxc_pivot_root(const char *rootfs)
TRACE("pivot_root(\"%s\") successful", rootfs); TRACE("pivot_root(\"%s\") successful", rootfs);
on_error: on_error:
if (oldroot != -1)
close(oldroot); close(oldroot);
if (newroot != -1)
if (newroot >= 0)
close(newroot); close(newroot);
return ret; return ret;
......
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