diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-11-10 12:14:28 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-11-10 15:52:32 +0100 |
commit | 44ee03d111ac40e11881e2b16f31bdf30ea8ed96 (patch) | |
tree | 3cbb860f45582dacfd15e9615ecfdd6c53282222 /src/test/test-execute.c | |
parent | basic/env-util: add little helper to call setenv or unsetenv (diff) | |
download | systemd-44ee03d111ac40e11881e2b16f31bdf30ea8ed96.tar.xz systemd-44ee03d111ac40e11881e2b16f31bdf30ea8ed96.zip |
tree-wide: unsetenv cannot fail
... when called with a valid environment variable name. This means that
any time we call it with a fixed string, it is guaranteed to return 0.
(Also when the variable is not present in the environment block.)
Diffstat (limited to 'src/test/test-execute.c')
-rw-r--r-- | src/test/test-execute.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/test-execute.c b/src/test/test-execute.c index e15b7a55fa..3b6a4be260 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -898,11 +898,11 @@ int main(int argc, char *argv[]) { } #endif - (void) unsetenv("USER"); - (void) unsetenv("LOGNAME"); - (void) unsetenv("SHELL"); - (void) unsetenv("HOME"); - (void) unsetenv("TMPDIR"); + assert_se(unsetenv("USER") == 0); + assert_se(unsetenv("LOGNAME") == 0); + assert_se(unsetenv("SHELL") == 0); + assert_se(unsetenv("HOME") == 0); + assert_se(unsetenv("TMPDIR") == 0); can_unshare = have_namespaces(); |