From: Dmitry V. Levin Date: Mon, 23 May 2016 16:39:23 +0000 (+0000) Subject: tests/attach-p-cmd-cmd.c: fix potential errno clobbering X-Git-Tag: v4.12~103 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=475d2b5da6dda57abdf10e26d1f3699e6f7c9619;p=strace tests/attach-p-cmd-cmd.c: fix potential errno clobbering * tests/attach-p-cmd-cmd.c (main): Call getpid before chdir. --- diff --git a/tests/attach-p-cmd-cmd.c b/tests/attach-p-cmd-cmd.c index 28f5e359..d2b3ca1f 100644 --- a/tests/attach-p-cmd-cmd.c +++ b/tests/attach-p-cmd-cmd.c @@ -36,8 +36,8 @@ int main(void) { static const char text[] = "attach-p-cmd.test cmd"; - assert(chdir(text) == -1); pid_t pid = getpid(); + assert(chdir(text) == -1); printf("%-5d chdir(\"%s\") = -1 ENOENT (%m)\n" "%-5d +++ exited with 0 +++\n", pid, text, pid); return 0;