mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 08:56:01 +01:00
Error messages if setsid or fork fail
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
32ad46441c
commit
96597253c8
1 changed files with 7 additions and 2 deletions
|
@ -4,6 +4,7 @@
|
|||
#include <girara/settings.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <glib/gstdio.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <locale.h>
|
||||
#include <stdio.h>
|
||||
|
@ -155,10 +156,14 @@ main(int argc, char* argv[])
|
|||
if (pid > 0) { /* parent */
|
||||
return 0;
|
||||
} else if (pid < 0) { /* error */
|
||||
girara_error("Couldn't fork.");
|
||||
girara_error("Could not fork: %s", strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
setsid();
|
||||
if (setsid() == -1) {
|
||||
girara_error("Could not start new process group: %s", strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* create zathura session */
|
||||
|
|
Loading…
Reference in a new issue