chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
hostnamectl: add more really basic system info to the status output
[elogind.git]
/
src
/
core
/
switch-root.c
diff --git
a/src/core/switch-root.c
b/src/core/switch-root.c
index efc7d345e1a83ca28a861b69eda9b0ee92cac281..150332a8587b841e8bd6a767fe6c8ce50393dbd3 100644
(file)
--- a/
src/core/switch-root.c
+++ b/
src/core/switch-root.c
@@
-115,6
+115,12
@@
int switch_root(const char *new_root) {
goto fail;
}
+ if (chdir("/") < 0) {
+ r = -errno;
+ log_error("Failed to change directory: %m");
+ goto fail;
+ }
+
if (old_root_fd >= 0) {
struct stat rb;