summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--upgraded/upgraded.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/upgraded/upgraded.c b/upgraded/upgraded.c
index 09c623c..220da79 100644
--- a/upgraded/upgraded.c
+++ b/upgraded/upgraded.c
@@ -78,7 +78,10 @@ int main(int argc, char **argv)
return 1;
}
- chroot(".");
+ if (chroot(".") < 0) {
+ fprintf(stderr, "failed to chroot: %s\n", strerror(errno));
+ return 1;
+ }
if (fchdir(fd) == -1) {
fprintf(stderr, "failed to chdir to prefix directory: %s\n", strerror(errno));