Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Rings:1-MinimalX
icewm
icewm-exit-fork.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File icewm-exit-fork.patch of Package icewm
Author: Fabian Vogt <fvogt@suse.com> Subject: Start shutdown and reboot commands in background When polkit is enabled, systemctl may in turn wait for the graphical password prompt to return. The created window cannot be handled by icewm as it is busy with systemctl. This avoids this deadlock by starting systemctl in background. --- src/wmmgr.cc | 23 +++++++++++++++++++---- src/wmmgr.h | 1 + 2 files changed, 20 insertions(+), 4 deletions(-) Index: icewm-1.3.12/src/wmmgr.cc =================================================================== --- icewm-1.3.12.orig/src/wmmgr.cc +++ icewm-1.3.12/src/wmmgr.cc @@ -3011,16 +3011,30 @@ void YWindowManager::updateUserTime(Time } } +void YWindowManager::execAfterFork(const char *command) { + pid_t pid = fork(); + switch(pid) { + case -1: /* Failed */ + warn("fork failed (%d)", errno); + return; + case 0: /* Child */ + execl("/bin/sh", "sh", "-c", command, (char *) 0); + return; /* Never reached */ + default: /* Parent */ + return; + } +} + void YWindowManager::checkLogout() { if (fShuttingDown && !haveClients()) { + fShuttingDown = false; /* Only run the command once */ + if (rebootOrShutdown == 1 && rebootCommand && rebootCommand[0]) { msg("reboot... (%s)", rebootCommand); - if (system(rebootCommand) == -1) - return; + execAfterFork(rebootCommand); } else if (rebootOrShutdown == 2 && shutdownCommand && shutdownCommand[0]) { msg("shutdown ... (%s)", shutdownCommand); - if (system(shutdownCommand) == -1) - return; + execAfterFork(shutdownCommand); } else app->exit(0); } Index: icewm-1.3.12/src/wmmgr.h =================================================================== --- icewm-1.3.12.orig/src/wmmgr.h +++ icewm-1.3.12/src/wmmgr.h @@ -188,6 +188,7 @@ public: void wmCloseSession(); void exitAfterLastClient(bool shuttingDown); + void execAfterFork(const char *command); void checkLogout(); virtual void resetColormap(bool active);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor