1
0
Fork 0
mirror of https://github.com/tuxedocomputers/tuxedo-touchpad-switch.git synced 2025-01-18 11:41:10 +01:00

Add gracefull exit on previously unhandled error cases

This commit is contained in:
Werner Sembach 2022-03-04 12:31:23 +01:00
parent f510c10a03
commit 6d3bde274a

View file

@ -101,10 +101,18 @@ int main() {
gracefull_exit(SIGTERM);
}
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")) {
setup_kde(lockfile);
int ret = setup_kde(lockfile);
if (ret != EXIT_SUCCESS) {
cerr << "main(...): setup_kde(...) failed." << endl;
gracefull_exit(-ret);
}
}
else {
cout << "Your desktop environment is not supported." << endl;