kern_exec.c (29041) | kern_exec.c (29653) |
---|---|
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 * $Id: kern_exec.c,v 1.64 1997/08/04 05:39:24 davidg Exp $ | 26 * $Id: kern_exec.c,v 1.65 1997/09/02 20:05:38 bde Exp $ |
27 */ 28 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/sysproto.h> 32#include <sys/signalvar.h> 33#include <sys/kernel.h> 34#include <sys/mount.h> --- 184 unchanged lines hidden (view full) --- 219 brelse(bp); 220 bp = NULL; 221 } else { 222 free((void *)imgp->image_header, M_TEMP); 223 imgp->image_header = NULL; 224 } 225 /* free old vnode and name buffer */ 226 vrele(ndp->ni_vp); | 27 */ 28 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/sysproto.h> 32#include <sys/signalvar.h> 33#include <sys/kernel.h> 34#include <sys/mount.h> --- 184 unchanged lines hidden (view full) --- 219 brelse(bp); 220 bp = NULL; 221 } else { 222 free((void *)imgp->image_header, M_TEMP); 223 imgp->image_header = NULL; 224 } 225 /* free old vnode and name buffer */ 226 vrele(ndp->ni_vp); |
227 FREE(ndp->ni_cnd.cn_pnbuf, M_NAMEI); | 227 zfree(namei_zone, ndp->ni_cnd.cn_pnbuf); |
228 /* set new name to that of the interpreter */ 229 NDINIT(ndp, LOOKUP, LOCKLEAF | FOLLOW | SAVENAME, 230 UIO_SYSSPACE, imgp->interpreter_name, p); 231 goto interpret; 232 } 233 break; 234 } 235 /* If we made it through all the activators and none matched, exit. */ --- 115 unchanged lines hidden (view full) --- 351 * free various allocated resources 352 */ 353 kmem_free_wakeup(exec_map, (vm_offset_t)imgp->stringbase, ARG_MAX); 354 if (bp != NULL) 355 brelse(bp); 356 else if (imgp->image_header != NULL) 357 free((void *)imgp->image_header, M_TEMP); 358 vrele(ndp->ni_vp); | 228 /* set new name to that of the interpreter */ 229 NDINIT(ndp, LOOKUP, LOCKLEAF | FOLLOW | SAVENAME, 230 UIO_SYSSPACE, imgp->interpreter_name, p); 231 goto interpret; 232 } 233 break; 234 } 235 /* If we made it through all the activators and none matched, exit. */ --- 115 unchanged lines hidden (view full) --- 351 * free various allocated resources 352 */ 353 kmem_free_wakeup(exec_map, (vm_offset_t)imgp->stringbase, ARG_MAX); 354 if (bp != NULL) 355 brelse(bp); 356 else if (imgp->image_header != NULL) 357 free((void *)imgp->image_header, M_TEMP); 358 vrele(ndp->ni_vp); |
359 FREE(ndp->ni_cnd.cn_pnbuf, M_NAMEI); | 359 zfree(namei_zone, ndp->ni_cnd.cn_pnbuf); |
360 361 return (0); 362 363exec_fail_dealloc: 364 if (imgp->stringbase != NULL) 365 kmem_free_wakeup(exec_map, (vm_offset_t)imgp->stringbase, ARG_MAX); 366 if (bp != NULL) 367 brelse(bp); 368 else if (imgp->image_header != NULL) 369 free((void *)imgp->image_header, M_TEMP); 370 if (ndp->ni_vp) { 371 vrele(ndp->ni_vp); | 360 361 return (0); 362 363exec_fail_dealloc: 364 if (imgp->stringbase != NULL) 365 kmem_free_wakeup(exec_map, (vm_offset_t)imgp->stringbase, ARG_MAX); 366 if (bp != NULL) 367 brelse(bp); 368 else if (imgp->image_header != NULL) 369 free((void *)imgp->image_header, M_TEMP); 370 if (ndp->ni_vp) { 371 vrele(ndp->ni_vp); |
372 FREE(ndp->ni_cnd.cn_pnbuf, M_NAMEI); | 372 zfree(namei_zone, ndp->ni_cnd.cn_pnbuf); |
373 } 374 375exec_fail: 376 if (imgp->vmspace_destroyed) { 377 /* sorry, no more process anymore. exit gracefully */ 378 exit1(p, W_EXITCODE(0, SIGABRT)); 379 /* NOT REACHED */ 380 return(0); --- 285 unchanged lines hidden --- | 373 } 374 375exec_fail: 376 if (imgp->vmspace_destroyed) { 377 /* sorry, no more process anymore. exit gracefully */ 378 exit1(p, W_EXITCODE(0, SIGABRT)); 379 /* NOT REACHED */ 380 return(0); --- 285 unchanged lines hidden --- |