Changeset 388


Ignore:
Timestamp:
Apr 6, 2009, 1:02:38 AM (12 years ago)
Author:
khorben
Message:

Merge from upstream

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Apps/Unix/Sources/sh/src/job.c

    r181 r388  
    1 /* $Id: job.c,v 1.7 2008-03-12 01:10:24 khorben Exp $ */
    2 /* Copyright (c) 2007 Pierre Pronchery <khorben@defora.org> */
     1/* $Id: job.c,v 1.9 2009/04/05 22:59:03 khorben Exp $ */
     2/* Copyright (c) 2009 Pierre Pronchery <khorben@defora.org> */
    33/* This file is part of DeforaOS Unix sh */
    44/* sh is not free software; you can redistribute it and/or modify it under the
     
    7777{
    7878        int status;
    79         int ret;
    8079
    81         while((ret = waitpid(jobs[id-1].pid, &status, 0)) != -1)
    82                 if(WIFEXITED(status) || WIFSIGNALED(status))
     80        for(;;)
     81                if(waitpid(jobs[id - 1].pid, &status, 0) == -1)
     82                        return sh_error("waitpid", -1);
     83                else if(WIFEXITED(status) || WIFSIGNALED(status))
    8384                        break;
    84         if(ret == -1)
    85                 return sh_error("waitpid", -1);
    8685        _job_remove(id);
    8786        return WEXITSTATUS(status);
Note: See TracChangeset for help on using the changeset viewer.