diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-01-10 16:09:52 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-01-10 21:23:14 +0100 |
commit | 0192cbdb2c19ed2abbf6662090f45ab3bf4caf56 (patch) | |
tree | 97abcf845575b1b5a0b47a8935bb8b713ffab6f0 /src/test/test-util.c | |
parent | docs: note that udev doesn't deal with binary attribute values (#11383) (diff) | |
download | systemd-0192cbdb2c19ed2abbf6662090f45ab3bf4caf56.tar.xz systemd-0192cbdb2c19ed2abbf6662090f45ab3bf4caf56.zip |
Revert "nss: prevent PROTECT_ERRNO from squashing changes to *errnop"
This reverts commit b26c90411343d74b15deb24bd87077848e316dab.
I don't see anythign wrong, but Ubuntu autopkgtest CI started failing fairly
consistently since this was merged. Let's see if reverting fixes things.
Diffstat (limited to 'src/test/test-util.c')
-rw-r--r-- | src/test/test-util.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/src/test/test-util.c b/src/test/test-util.c index 95eebde6b0..3c1b5f9b41 100644 --- a/src/test/test-util.c +++ b/src/test/test-util.c @@ -213,70 +213,6 @@ static void test_protect_errno(void) { assert_se(errno == 12); } -static void test_protect_errno_disarmed(void) { - log_info("/* %s */", __func__); - - errno = 12; - /** - * Simulate dynamically-linked glibc calling the NSS module with errnop - * and &errno being the same. - */ - int *errnop = &errno; - - { - PROTECT_ERRNO; - - *errnop = DISARM_PROTECT_ERRNO(25); - } - - assert_se(errno == 25); - assert_se(*errnop == 25); -} - -static void test_protect_errno_disarmed_inner(void) { - log_info("/* %s */", __func__); - - errno = 12; - int *errnop = &errno; - - { - PROTECT_ERRNO; - - int *_saved_errno_p = &_saved_errno_; - *errnop = DISARM_PROTECT_ERRNO_INNER(25); - } - - assert_se(errno == 25); - assert_se(*errnop == 25); -} - -static void test_protect_errno_disarmed_static(void) { - log_info("/* %s */", __func__); - - errno = 12; - /* - * "In statically linked programs, the main application and NSS - * modules do not share the same thread-local variable errno, - * which is the reason why there is an explicit errnop function - * argument." - */ - int errno2 = 15; - int *errnop = &errno2; - - { - PROTECT_ERRNO; - - errno = 13; - *errnop = DISARM_PROTECT_ERRNO(25); - assert_se(errno == 12); - - errno = 14; - } - - assert_se(errno == 14); - assert_se(*errnop == 25); -} - static void test_in_set(void) { log_info("/* %s */", __func__); @@ -447,9 +383,6 @@ int main(int argc, char *argv[]) { test_div_round_up(); test_u64log2(); test_protect_errno(); - test_protect_errno_disarmed(); - test_protect_errno_disarmed_inner(); - test_protect_errno_disarmed_static(); test_in_set(); test_log2i(); test_eqzero(); |