Message ID | 20180622215710.126661-1-astrachan@google.com |
---|---|
State | Accepted |
Delegated to: | Petr Vorel |
Headers | show |
Series | pathconf01: Use TMPDIR instead of "/tmp" if set | expand |
----- Original Message -----
> Enable this test to work in environments without a /tmp directory.
Pushed.
Thanks,
Jan
diff --git a/testcases/kernel/syscalls/pathconf/pathconf01.c b/testcases/kernel/syscalls/pathconf/pathconf01.c index ddbe87f7a..362bae94f 100644 --- a/testcases/kernel/syscalls/pathconf/pathconf01.c +++ b/testcases/kernel/syscalls/pathconf/pathconf01.c @@ -154,7 +154,8 @@ int main(int ac, char **av) tst_parse_opts(ac, av, options, &help); if (!lflag) { - path = strdup("/tmp"); + tst_tmpdir(); + path = tst_get_tmpdir(); } /*************************************************************** * perform global setup for test @@ -221,7 +222,10 @@ void setup(void) ***************************************************************/ void cleanup(void) { - + if (!lflag) { + tst_rmdir(); + free(path); + } } /***************************************************************
Enable this test to work in environments without a /tmp directory. Signed-off-by: Alistair Strachan <astrachan@google.com> --- testcases/kernel/syscalls/pathconf/pathconf01.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)