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:
parent
f510c10a03
commit
6d3bde274a
1 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue