would this code snippet correctly check for the status 
            wait(&status); // wait

            if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { // If it is equal to 0
                printf(SUCCESS);
            } else {
                printf(INVALID);
            }