diff --git a/zathura/main.c b/zathura/main.c index eb419b0..3c6f0dd 100644 --- a/zathura/main.c +++ b/zathura/main.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -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 */