/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* close a proc opened by procopen()
* otherwise exit() status of process is returned
*/
#include "proclib.h"
int
{
int pid;
int flags = 0;
if (p)
{
if (p->rfd >= 0)
if (p->flags & PROC_ORPHAN)
status = 0;
else
{
if (p->flags & PROC_ZOMBIE)
{
/*
* process may leave a zombie behind
* give it a chance to do that but
* don't hang waiting for it
*/
sleep(1);
}
if (!(p->flags & PROC_FOREGROUND))
status = 0;
if (!(p->flags & PROC_FOREGROUND))
sigcritical(0);
else
{
#if defined(SIGCHLD)
#if _lib_sigprocmask
#else
#if _lib_sigsetmask
sigsetmask(p->mask);
#else
#endif
#endif
#endif
}
}
procfree(p);
}
else
return status;
}