Add gracefull exit on previously unhandled error cases

pull/13/head
Werner Sembach 3 years ago
parent f510c10a03
commit 6d3bde274a

@ -101,10 +101,18 @@ int main() {
gracefull_exit(SIGTERM); gracefull_exit(SIGTERM);
} }
else if (strstr(xdg_current_desktop, "GNOME")) { else if (strstr(xdg_current_desktop, "GNOME")) {
setup_gnome(lockfile); int ret = setup_gnome(lockfile);
if (ret != EXIT_SUCCESS) {
cerr << "main(...): setup_gnome(...) failed." << endl;
gracefull_exit(-ret);
}
} }
else if (strstr(xdg_current_desktop, "KDE")) { else if (strstr(xdg_current_desktop, "KDE")) {
setup_kde(lockfile); int ret = setup_kde(lockfile);
if (ret != EXIT_SUCCESS) {
cerr << "main(...): setup_kde(...) failed." << endl;
gracefull_exit(-ret);
}
} }
else { else {
cout << "Your desktop environment is not supported." << endl; cout << "Your desktop environment is not supported." << endl;

Loading…
Cancel
Save