chiark / gitweb /
util: rename write_one_line_file() to write_string_file()
[elogind.git] / src / nspawn / nspawn.c
index 1a3e41f4037ae205923110cbf7193b70f0e24e81..01ef12bf67bbbf0dda4095bad7d2bb037988dd15 100644 (file)
@@ -528,7 +528,7 @@ static int setup_boot_id(const char *dest) {
                  SD_ID128_FORMAT_VAL(rnd));
         char_array_0(as_uuid);
 
-        r = write_one_line_file(from, as_uuid);
+        r = write_string_file(from, as_uuid);
         if (r < 0) {
                 log_error("Failed to write boot id: %s", strerror(-r));
                 return r;
@@ -537,8 +537,8 @@ static int setup_boot_id(const char *dest) {
         if (mount(from, to, "bind", MS_BIND, NULL) < 0) {
                 log_error("Failed to bind mount boot id: %m");
                 r = -errno;
-        } else
-                mount(from, to, "bind", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL);
+        } else if (mount(from, to, "bind", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL))
+                log_warning("Failed to make boot id read-only: %m");
 
         unlink(from);
         return r;
@@ -1589,7 +1589,7 @@ int main(int argc, char *argv[]) {
                         _exit(EXIT_FAILURE);
                 }
 
-                log_info("Init process in the container running as PID %d", pid);
+                log_info("Init process in the container running as PID %lu.", (unsigned long) pid);
                 close_nointr_nofail(pipefd[0]);
                 close_nointr_nofail(pipefd[1]);