kern_exec.c (109606) | kern_exec.c (109623) |
---|---|
1/* 2 * Copyright (c) 1993, David Greenman 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/* 2 * Copyright (c) 1993, David Greenman 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/kern/kern_exec.c 109606 2003-01-21 03:26:28Z rwatson $ | 26 * $FreeBSD: head/sys/kern/kern_exec.c 109623 2003-01-21 08:56:16Z alfred $ |
27 */ 28 29#include "opt_ktrace.h" 30#include "opt_mac.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/lock.h> --- 388 unchanged lines hidden (view full) --- 423 * reset. 424 */ 425 PROC_LOCK(p); 426 mp_fixme("procsig needs a lock"); 427 if (p->p_procsig->ps_refcnt > 1) { 428 oldprocsig = p->p_procsig; 429 PROC_UNLOCK(p); 430 MALLOC(newprocsig, struct procsig *, sizeof(struct procsig), | 27 */ 28 29#include "opt_ktrace.h" 30#include "opt_mac.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/lock.h> --- 388 unchanged lines hidden (view full) --- 423 * reset. 424 */ 425 PROC_LOCK(p); 426 mp_fixme("procsig needs a lock"); 427 if (p->p_procsig->ps_refcnt > 1) { 428 oldprocsig = p->p_procsig; 429 PROC_UNLOCK(p); 430 MALLOC(newprocsig, struct procsig *, sizeof(struct procsig), |
431 M_SUBPROC, M_WAITOK); | 431 M_SUBPROC, 0); |
432 bcopy(oldprocsig, newprocsig, sizeof(*newprocsig)); 433 newprocsig->ps_refcnt = 1; 434 oldprocsig->ps_refcnt--; 435 PROC_LOCK(p); 436 p->p_procsig = newprocsig; 437 if (p->p_sigacts == &p->p_uarea->u_sigacts) 438 panic("shared procsig but private sigacts?"); 439 --- 729 unchanged lines hidden (view full) --- 1169 const struct execsw *execsw_arg; 1170{ 1171 const struct execsw **es, **xs, **newexecsw; 1172 int count = 2; /* New slot and trailing NULL */ 1173 1174 if (execsw) 1175 for (es = execsw; *es; es++) 1176 count++; | 432 bcopy(oldprocsig, newprocsig, sizeof(*newprocsig)); 433 newprocsig->ps_refcnt = 1; 434 oldprocsig->ps_refcnt--; 435 PROC_LOCK(p); 436 p->p_procsig = newprocsig; 437 if (p->p_sigacts == &p->p_uarea->u_sigacts) 438 panic("shared procsig but private sigacts?"); 439 --- 729 unchanged lines hidden (view full) --- 1169 const struct execsw *execsw_arg; 1170{ 1171 const struct execsw **es, **xs, **newexecsw; 1172 int count = 2; /* New slot and trailing NULL */ 1173 1174 if (execsw) 1175 for (es = execsw; *es; es++) 1176 count++; |
1177 newexecsw = malloc(count * sizeof(*es), M_TEMP, M_WAITOK); | 1177 newexecsw = malloc(count * sizeof(*es), M_TEMP, 0); |
1178 if (newexecsw == NULL) 1179 return (ENOMEM); 1180 xs = newexecsw; 1181 if (execsw) 1182 for (es = execsw; *es; es++) 1183 *xs++ = *es; 1184 *xs++ = execsw_arg; 1185 *xs = NULL; --- 17 unchanged lines hidden (view full) --- 1203 if (*es == execsw_arg) 1204 break; 1205 } 1206 if (*es == NULL) 1207 return (ENOENT); 1208 for (es = execsw; *es; es++) 1209 if (*es != execsw_arg) 1210 count++; | 1178 if (newexecsw == NULL) 1179 return (ENOMEM); 1180 xs = newexecsw; 1181 if (execsw) 1182 for (es = execsw; *es; es++) 1183 *xs++ = *es; 1184 *xs++ = execsw_arg; 1185 *xs = NULL; --- 17 unchanged lines hidden (view full) --- 1203 if (*es == execsw_arg) 1204 break; 1205 } 1206 if (*es == NULL) 1207 return (ENOENT); 1208 for (es = execsw; *es; es++) 1209 if (*es != execsw_arg) 1210 count++; |
1211 newexecsw = malloc(count * sizeof(*es), M_TEMP, M_WAITOK); | 1211 newexecsw = malloc(count * sizeof(*es), M_TEMP, 0); |
1212 if (newexecsw == NULL) 1213 return (ENOMEM); 1214 xs = newexecsw; 1215 for (es = execsw; *es; es++) 1216 if (*es != execsw_arg) 1217 *xs++ = *es; 1218 *xs = NULL; 1219 if (execsw) --- 44 unchanged lines hidden --- | 1212 if (newexecsw == NULL) 1213 return (ENOMEM); 1214 xs = newexecsw; 1215 for (es = execsw; *es; es++) 1216 if (*es != execsw_arg) 1217 *xs++ = *es; 1218 *xs = NULL; 1219 if (execsw) --- 44 unchanged lines hidden --- |