VirtualBox

Changeset 758 in kBuild for trunk/src/gmake/kmkbuiltin/install.c


Ignore:
Timestamp:
Jan 13, 2007 1:36:23 AM (18 years ago)
Author:
bird
Message:

use waitpid(pid) since wait() interfers with any parallel jobs gnu make might be executing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gmake/kmkbuiltin/install.c

    r557 r758  
    185185                                return errx(EX_USAGE, "%s: invalid flag", flags);
    186186                        iflags |= SETFLAGS;
    187 #else   
     187#else
    188188                        (void)flags;
    189189#endif
     
    864864        const char *stripbin;
    865865        int serrno, status;
    866 
    867         switch (fork()) {
     866        pid_t pid;
     867
     868        pid = fork();
     869        switch (pid) {
    868870        case -1:
    869871                serrno = errno;
     
    878880                err(EX_OSERR, "exec(%s)", stripbin);
    879881        default:
    880                 if (wait(&status) == -1 || status) {
     882                if (waitpid(pid, &status, 0) == -1 || status) {
    881883                        serrno = errno;
    882884                        (void)unlink(to_name);
    883885                        errno = serrno;
    884                         err(EX_SOFTWARE, "wait");
     886                        err(EX_SOFTWARE, "waitpid");
    885887                        /* NOTREACHED */
    886888                }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette