summaryrefslogtreecommitdiff
path: root/src/nspawn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nspawn.c')
-rw-r--r--src/nspawn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nspawn.c b/src/nspawn.c
index 8c3cf6bfaa..6f484e78e0 100644
--- a/src/nspawn.c
+++ b/src/nspawn.c
@@ -197,8 +197,10 @@ static int mount_all(const char *dest) {
/* Fix the timezone, if possible */
if (asprintf(&where, "%s/%s", dest, "/etc/localtime") >= 0) {
- mount("/etc/localtime", where, "bind", MS_BIND, NULL);
- mount("/etc/localtime", where, "bind", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL);
+
+ if (mount("/etc/localtime", where, "bind", MS_BIND, NULL) >= 0)
+ mount("/etc/localtime", where, "bind", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL);
+
free(where);
}