diff options
author | marha <marha@users.sourceforge.net> | 2012-08-07 08:28:39 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-08-07 08:28:39 +0200 |
commit | 666141b21e89c617ca466af62ebcb56dc4f5450c (patch) | |
tree | 4d0cddde47b6d8cbc92395dc2091849f89d68138 /xorg-server/test/os.c | |
parent | e158f8fc4a9cf2f884d156ff2dfc0870facfbcba (diff) | |
parent | f8e35ebbe71eed74ccf68af8ccda4182f1edc7f0 (diff) | |
download | vcxsrv-666141b21e89c617ca466af62ebcb56dc4f5450c.tar.gz vcxsrv-666141b21e89c617ca466af62ebcb56dc4f5450c.tar.bz2 vcxsrv-666141b21e89c617ca466af62ebcb56dc4f5450c.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
xorg-server/hw/xwin/glx/indirect.c
xorg-server/hw/xwin/winclipboardwndproc.c
xorg-server/hw/xwin/winmultiwindowicons.c
xorg-server/hw/xwin/winmultiwindowwindow.c
xorg-server/hw/xwin/winmultiwindowwm.c
xorg-server/hw/xwin/winwin32rootlesswindow.c
xorg-server/hw/xwin/winwindow.h
Diffstat (limited to 'xorg-server/test/os.c')
-rw-r--r-- | xorg-server/test/os.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/xorg-server/test/os.c b/xorg-server/test/os.c index 1460a34d6..8f1107ded 100644 --- a/xorg-server/test/os.c +++ b/xorg-server/test/os.c @@ -28,6 +28,21 @@ #include <signal.h> #include "os.h" +static int last_signal = 0; +static int expect_signal = 0; + +static void sighandler(int signal) +{ + assert(expect_signal); + expect_signal = 0; + if (!last_signal) + raise(signal); + OsBlockSignals(); + OsReleaseSignals(); + last_signal = 1; + expect_signal = 1; +} + static int sig_is_blocked(int sig) { @@ -118,7 +133,27 @@ static void block_sigio_test(void) assert(sig_is_blocked(SIGIO)); OsReleaseSignals(); assert(!sig_is_blocked(SIGIO)); +#endif +} +static void block_sigio_test_nested(void) +{ +#ifdef SIG_BLOCK + /* Check for bug releasing SIGIO during SIGIO signal handling. + test case: + raise signal + → in signal handler: + raise signal + OsBlockSignals() + OsReleaseSignals() + tail guard + tail guard must be hit. + */ + sighandler_t old_handler; + old_handler = signal(SIGIO, sighandler); + expect_signal = 1; + assert(raise(SIGIO) == 0); + assert(signal(SIGIO, old_handler) == sighandler); #endif } @@ -126,5 +161,6 @@ int main(int argc, char **argv) { block_sigio_test(); + block_sigio_test_nested(); return 0; } |