After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 727425 - Bindings for posix sigemptyset, sigaddset do not modify the sigset_t argument
Bindings for posix sigemptyset, sigaddset do not modify the sigset_t argument
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
0.24.x
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-01 12:01 UTC by Sebastian Zenker
Modified: 2018-02-14 19:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix sig*set and sigprocmask in posix.vapi (1.54 KB, patch)
2014-04-05 16:49 UTC, Luca Bruno
committed Details | Review

Description Sebastian Zenker 2014-04-01 12:01:10 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.
Comment 1 Luca Bruno 2014-04-05 16:49:08 UTC
Created attachment 273637 [details] [review]
fix sig*set and sigprocmask in posix.vapi

What about this? I haven't tested it.
Comment 2 Michael 'Mickey' Lauer 2018-02-14 16:35:58 UTC
Review of attachment 273637 [details] [review]:

This patch is correct. The signal functions do not work otherwise.
Comment 3 Rico Tzschichholz 2018-02-14 19:51:16 UTC
Thanks for testing and confirming.