Home | History | Annotate | Download | only in lpsched
      1     0  stevel /*
      2     0  stevel  * CDDL HEADER START
      3     0  stevel  *
      4     0  stevel  * The contents of this file are subject to the terms of the
      5  3125  jacobs  * Common Development and Distribution License (the "License").
      6  3125  jacobs  * You may not use this file except in compliance with the License.
      7     0  stevel  *
      8     0  stevel  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9     0  stevel  * or http://www.opensolaris.org/os/licensing.
     10     0  stevel  * See the License for the specific language governing permissions
     11     0  stevel  * and limitations under the License.
     12     0  stevel  *
     13     0  stevel  * When distributing Covered Code, include this CDDL HEADER in each
     14     0  stevel  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15     0  stevel  * If applicable, add the following below this CDDL HEADER, with the
     16     0  stevel  * fields enclosed by brackets "[]" replaced with your own identifying
     17     0  stevel  * information: Portions Copyright [yyyy] [name of copyright owner]
     18     0  stevel  *
     19     0  stevel  * CDDL HEADER END
     20     0  stevel  */
     21  3125  jacobs 
     22     0  stevel /*
     23  3125  jacobs  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
     24     0  stevel  * Use is subject to license terms.
     25     0  stevel  */
     26     0  stevel 
     27     0  stevel /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
     28     0  stevel /*	  All Rights Reserved  	*/
     29     0  stevel 
     30     0  stevel 
     31     0  stevel #pragma ident	"%Z%%M%	%I%	%E% SMI"
     32     0  stevel 
     33     0  stevel #include "dispatch.h"
     34     0  stevel #include <syslog.h>
     35     0  stevel 
     36     0  stevel extern int		Net_fd;
     37     0  stevel 
     38     0  stevel extern MESG *		Net_md;
     39     0  stevel 
     40     0  stevel /**
     41     0  stevel  ** s_child_done()
     42     0  stevel  **/
     43     0  stevel 
     44     0  stevel void
     45     0  stevel s_child_done(char *m, MESG *md)
     46     0  stevel {
     47     0  stevel 	long			key;
     48     0  stevel 	short			status;
     49     0  stevel 	short			err;
     50  3125  jacobs 	int			i;
     51     0  stevel 
     52     0  stevel 
     53  3125  jacobs 	getmessage (m, S_CHILD_DONE, &key, &status, &err);
     54  3125  jacobs 	syslog(LOG_DEBUG, "s_child_done(%d, %d, %d)", key, status, err);
     55     0  stevel 
     56  3125  jacobs 	for (i = 0; Exec_Table[i] != NULL; i++)
     57  3125  jacobs 		if ((Exec_Table[i]->key == key) && (Exec_Table[i]->md == md)) {
     58  3125  jacobs 			EXEC *ep = Exec_Table[i];
     59     0  stevel 
     60  3125  jacobs 			syslog(LOG_DEBUG,
     61  3125  jacobs 				"s_child_done(%d, 0x%8.8x): clearing 0x%8.8x",
     62  3125  jacobs 				key, md, ep);
     63  3125  jacobs 			/*
     64  3125  jacobs 		 	* Remove the message descriptor from the listen
     65  3125  jacobs 		 	* table, then forget about it; we don't want to
     66  3125  jacobs 		 	* accidently match this exec-slot to a future,
     67  3125  jacobs 		 	* unrelated child.
     68  3125  jacobs 		 	*/
     69  3125  jacobs 			DROP_MD (ep->md);
     70     0  stevel 
     71  3125  jacobs 			ep->pid = -99;
     72  3125  jacobs 			ep->status = status;
     73  3125  jacobs 			ep->Errno = err;
     74  3125  jacobs 			DoneChildren++;
     75  3125  jacobs 		}
     76     0  stevel 
     77     0  stevel 	return;
     78     0  stevel }
     79