Deleted Added
full compact
kern_sharedpage.c (108053) kern_sharedpage.c (108522)
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 108053 2002-12-18 20:16:22Z alc $
26 * $FreeBSD: head/sys/kern/kern_exec.c 108522 2003-01-01 01:19:31Z 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>

--- 337 unchanged lines hidden (view full) ---

372 /*
373 * For security and other reasons, the file descriptor table cannot
374 * be shared after an exec.
375 */
376 FILEDESC_LOCK(p->p_fd);
377 if (p->p_fd->fd_refcnt > 1) {
378 struct filedesc *tmp;
379
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>

--- 337 unchanged lines hidden (view full) ---

372 /*
373 * For security and other reasons, the file descriptor table cannot
374 * be shared after an exec.
375 */
376 FILEDESC_LOCK(p->p_fd);
377 if (p->p_fd->fd_refcnt > 1) {
378 struct filedesc *tmp;
379
380 tmp = fdcopy(td);
380 tmp = fdcopy(td->td_proc->p_fd);
381 FILEDESC_UNLOCK(p->p_fd);
382 fdfree(td);
383 p->p_fd = tmp;
384 } else
385 FILEDESC_UNLOCK(p->p_fd);
386
387 /*
388 * Malloc things before we need locks.

--- 859 unchanged lines hidden ---
381 FILEDESC_UNLOCK(p->p_fd);
382 fdfree(td);
383 p->p_fd = tmp;
384 } else
385 FILEDESC_UNLOCK(p->p_fd);
386
387 /*
388 * Malloc things before we need locks.

--- 859 unchanged lines hidden ---