void *cbparm[2];
struct lxc_list mountlist, *iterator;
int ok, still_mounted, last_still_mounted;
+ int remove_pivotdir = 0;
/* change into new root fs */
if (chdir(rootfs)) {
return -1;
}
+ remove_pivotdir = 1;
DEBUG("created '%s' directory", path);
}
/* remove temporary mount point, we don't consider the removing
* as fatal */
- if (rmdir(pivotdir))
- WARN("can't remove mountpoint: %m");
+ if (remove_pivotdir && rmdir(pivotdir))
+ WARN("can't remove mountpoint '%s': %m", pivotdir);
INFO("pivoted to '%s'", rootfs);
return 0;