chiark / gitweb /
coverity: change a few things so that coverity doesn't show so many false positives
[elogind.git] / src / nspawn.c
index 8c3cf6bfaaeb4ef491260b9efa6020ef21c577fd..6f484e78e0dfa4070814daf301245ff2eb1e43cf 100644 (file)
@@ -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);
         }