summaryrefslogtreecommitdiff
path: root/src/nspawn.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-09-23 01:44:36 +0200
committerLennart Poettering <lennart@poettering.net>2011-09-23 01:45:34 +0200
commitf8440af5febb18ddfd2bc7a94b771284f0b7b310 (patch)
tree83172e88ffe4251d3fe7765a1f5874e1a5135f1a /src/nspawn.c
parent8ea913b2eaadbd92e069ea6b71cc5f5df409decf (diff)
coverity: change a few things so that coverity doesn't show so many false positives
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 8c3cf6bfa..6f484e78e 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);
}