Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 830787 Details for
Bug 1036241
Mate terminal emulator blocks SIGINT and SIGHUP signals
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
program that can be used to display blocked signals or wait for signals
signal_catcher.cc (text/x-c++src), 1.88 KB, created by
Alexander Murashkin
on 2013-11-29 23:45:02 UTC
(
hide
)
Description:
program that can be used to display blocked signals or wait for signals
Filename:
MIME Type:
Creator:
Alexander Murashkin
Created:
2013-11-29 23:45:02 UTC
Size:
1.88 KB
patch
obsolete
>#include <sys/types.h> >#include <unistd.h> >#include <csignal> >#include <cstdlib> > >#include <cerrno> >#include <string> >#include <iostream> > >using namespace std; > >#define X(c) if ( (c) != 0 ) { clog << #c " failed, errno " << errno << endl; } > >void handler( int sig ) { > > clog << "\nGot signal " << sig << endl; > exit(EXIT_SUCCESS); >} > >void printSigprocmask( const string& comment ) { > > sigset_t sigs; > X(sigprocmask(0,NULL,&sigs)); > > bool empty=true; > clog << comment << " sigprocmask "; > for ( int i=1; i<SIGRTMIN; ++i ) { > if ( sigismember(&sigs,i) ) { clog << " " << i; empty = false; } > } > if ( empty ) clog << " empty"; > clog << endl; > >} > >int main( int argc, char* argv[] ) { > > bool do_list = false, do_wait = false, do_adjust = false, do_sigact = false; > > for ( int i=1; i<argc; ++i ) { > > if ( string("-w") == argv[i] ) do_wait = true; > else if ( string("-l") == argv[i] ) do_list = true; > else if ( string("-u") == argv[i] ) do_adjust = true; > else if ( string("-i") == argv[i] ) do_sigact = true; > } > > if ( !do_wait && !do_list && !do_adjust && !do_sigact ) do_list = true; > > printSigprocmask("inherited"); > > if ( do_sigact ) { > > struct sigaction act; > > act.sa_handler = handler; > //act.sa_sigaction = NULL; > act.sa_flags = 0; > sigemptyset(&act.sa_mask); > > X(sigaction(SIGINT,&act,NULL)); > X(sigaction(SIGHUP,&act,NULL)); > X(sigaction(SIGUSR1,&act,NULL)); > > printSigprocmask(" working"); > } > > if ( do_adjust ) { > > sigset_t sign; > sigemptyset ( &sign ); > sigaddset ( &sign, SIGINT ); > sigaddset ( &sign, SIGHUP ); > sigaddset ( &sign, SIGUSR1 ); > sigprocmask ( SIG_UNBLOCK, &sign, 0 ); > > printSigprocmask("adjusted"); > } > > if ( do_wait ) { > > clog << "Process " << getpid() << " is waiting for a signal" << endl; > sleep(1000); > } >} > > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1036241
: 830787