powerpc: harden the clock ATB probe a bit
[fio.git] / arch / arch-ppc.h
index 751762750dd5081b5710466b0d4b3c9b6d60b353..0cc0cbda7d69890e10ff41816d836b4189684963 100644 (file)
@@ -96,11 +96,11 @@ static void atb_clocktest(void)
        pid = fork();
        if (!pid)
                atb_child();
-       else {
+       else if (pid != -1) {
                int status;
 
-               wait(&status);
-               if (!WIFEXITED(status))
+               pid = wait(&status);
+               if (pid == -1 || !WIFEXITED(status))
                        arch_flags &= ~ARCH_FLAG_1;
                else
                        arch_flags |= ARCH_FLAG_1;