Checking if wait() failed

In order to know if wait() has worked, will it be correct to check it like the following? In theory, if wait() does not fail, should return to the parent process the ended child pid, otherwise parent pid will be 1, right?