GNOME Bugzilla – Bug 727425
Bindings for posix sigemptyset, sigaddset do not modify the sigset_t argument
Last modified: 2018-02-14 19:51:22 UTC
The following Vala-code: Posix.sigset_t sigSet = new Posix.sigset_t(); Posix.sigemptyset(sigSet); Posix.sigaddset(sigSet, Posix.SIGPIPE); Posix.sigset_t oldSet = new Posix.sigset_t(); Posix.sigprocmask(Posix.SIG_SETMASK, sigSet, oldSet); Is converted into the following C-code: sigset_t sigSet = {0}; sigset_t _tmp18_; sigset_t _tmp19_; sigset_t oldSet = {0}; sigset_t _tmp20_; sigset_t _tmp21_; ... memset (&sigSet, 0, sizeof (sigset_t)); _tmp18_ = sigSet; sigemptyset (&_tmp18_); _tmp19_ = sigSet; sigaddset (&_tmp19_, SIGPIPE); memset (&oldSet, 0, sizeof (sigset_t)); _tmp20_ = sigSet; _tmp21_ = oldSet; sigprocmask (SIG_SETMASK, &_tmp20_, &_tmp21_); Problem: the mask which is given to sigprocmask() is always empty. Instead, the argument to sigaddset() and sigemptyset() may be better a reference.
Created attachment 273637 [details] [review] fix sig*set and sigprocmask in posix.vapi What about this? I haven't tested it.
Review of attachment 273637 [details] [review]: This patch is correct. The signal functions do not work otherwise.
Thanks for testing and confirming.