1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -05:00

Merge pull request #311 from jasperla/no_sigwaitinfo

Workaround lack of sigwaitinfo() on OpenBSD.
This commit is contained in:
Dave Davenport 2016-01-03 20:56:47 +01:00
commit 2ec198d722

View file

@ -2244,11 +2244,18 @@ static gpointer rofi_signal_handler_process ( gpointer arg )
sigaddset ( &set, SIGUSR1 ); sigaddset ( &set, SIGUSR1 );
// loop forever. // loop forever.
while ( 1 ) { while ( 1 ) {
#ifdef __OpenBSD__
int sig = 0;
if ( sigwait ( &set, &sig ) < 0 ) {
perror ( "sigwaitinfo failed, lets restart" );
}
#else
siginfo_t info; siginfo_t info;
int sig = sigwaitinfo ( &set, &info ); int sig = sigwaitinfo ( &set, &info );
if ( sig < 0 ) { if ( sig < 0 ) {
perror ( "sigwaitinfo failed, lets restart" ); perror ( "sigwaitinfo failed, lets restart" );
} }
#endif
else { else {
// Send message to main thread. // Send message to main thread.
if ( sig == SIGHUP ) { if ( sig == SIGHUP ) {