chiark / gitweb /
nspawn: ignore EEXIST when creating mount point
[elogind.git] / src / nspawn / nspawn.c
index c567c8d2720fb8ae210e49f22107ccb0154fdc2a..d88987a5808f0d7e2340fa9fb7864102b52cec5b 100644 (file)
@@ -758,7 +758,7 @@ static int mount_binds(const char *dest, char **l, bool ro) {
                  * and char devices. */
                 if (S_ISDIR(source_st.st_mode)) {
                         r = mkdir_label(where, 0755);
-                        if (r < 0) {
+                        if (r < 0 && errno != EEXIST) {
                                 log_error("Failed to create mount point %s: %s", where, strerror(-r));
 
                                 return r;
@@ -1289,7 +1289,7 @@ static int setup_hostname(void) {
         if (arg_share_system)
                 return 0;
 
-        if (sethostname(arg_machine, strlen(arg_machine)) < 0)
+        if (sethostname_idempotent(arg_machine) < 0)
                 return -errno;
 
         return 0;