hib-res-generator: open logging before emitting the first message
Also add a debug message when we are not in initrd, because it can be confusing why nothing is happenning.
This commit is contained in:
parent
0307ea49c7
commit
a79858bfd1
|
@ -60,6 +60,13 @@ static int process_resume(void) {
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
int r = 0;
|
int r = 0;
|
||||||
|
|
||||||
|
log_set_prohibit_ipc(true);
|
||||||
|
log_set_target(LOG_TARGET_AUTO);
|
||||||
|
log_parse_environment();
|
||||||
|
log_open();
|
||||||
|
|
||||||
|
umask(0022);
|
||||||
|
|
||||||
if (argc > 1 && argc != 4) {
|
if (argc > 1 && argc != 4) {
|
||||||
log_error("This program takes three or no arguments.");
|
log_error("This program takes three or no arguments.");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
@ -68,16 +75,11 @@ int main(int argc, char *argv[]) {
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
arg_dest = argv[1];
|
arg_dest = argv[1];
|
||||||
|
|
||||||
log_set_prohibit_ipc(true);
|
|
||||||
log_set_target(LOG_TARGET_AUTO);
|
|
||||||
log_parse_environment();
|
|
||||||
log_open();
|
|
||||||
|
|
||||||
umask(0022);
|
|
||||||
|
|
||||||
/* Don't even consider resuming outside of initramfs. */
|
/* Don't even consider resuming outside of initramfs. */
|
||||||
if (!in_initrd())
|
if (!in_initrd()) {
|
||||||
|
log_debug("Not running in an initrd, quitting.");
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
r = proc_cmdline_parse(parse_proc_cmdline_item, NULL, 0);
|
r = proc_cmdline_parse(parse_proc_cmdline_item, NULL, 0);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
|
|
Loading…
Reference in New Issue