On Thu, 28.08.14 14:01, har...@redhat.com (har...@redhat.com) wrote: > > if (!in_container && !in_initrd() && > access("/run/initramfs/shutdown", X_OK) == 0) { > - > - if (prepare_new_root() >= 0 && > - pivot_to_new_root() >= 0) { > + if (switch_root_initramfs() >= 0) { > arguments[0] = (char*) "/shutdown"; > > - log_info("Returning to initrd..."); > + setsid(); > + make_console_stdio(); > + > + log_info("Successfully changed into root pivot.\n" > + "Returning to initrd..."); > > execv("/shutdown", arguments); > log_error("Failed to execute shutdown binary: %m"); > - } > + } else > + log_error("Failed to switch root to > \"/run/initramfs\": %m"); > }
The error of switch_root_initramfs() is returned in the return value, not in errno. Hence you need to store the result in some variable "r" first, and then print the error with %s and strerror(-r) instead of %m... Lennart -- Lennart Poettering, Red Hat _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel