Deleted Added
full compact
kern_linker.c (168951) kern_linker.c (170152)
1/*-
2 * Copyright (c) 1997-2000 Doug Rabson
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

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

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
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997-2000 Doug Rabson
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

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

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
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/kern/kern_linker.c 168951 2007-04-22 15:31:22Z rwatson $");
28__FBSDID("$FreeBSD: head/sys/kern/kern_linker.c 170152 2007-05-31 11:51:53Z kib $");
29
30#include "opt_ddb.h"
31#include "opt_hwpmc_hooks.h"
32#include "opt_mac.h"
33
34#include <sys/param.h>
35#include <sys/kernel.h>
36#include <sys/systm.h>

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

1505 snprintf(result, reclen, "%.*s%s%.*s%s", pathlen, path, sep,
1506 namelen, name, *cpp);
1507 /*
1508 * Attempt to open the file, and return the path if
1509 * we succeed and it's a regular file.
1510 */
1511 NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, result, td);
1512 flags = FREAD;
29
30#include "opt_ddb.h"
31#include "opt_hwpmc_hooks.h"
32#include "opt_mac.h"
33
34#include <sys/param.h>
35#include <sys/kernel.h>
36#include <sys/systm.h>

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

1505 snprintf(result, reclen, "%.*s%s%.*s%s", pathlen, path, sep,
1506 namelen, name, *cpp);
1507 /*
1508 * Attempt to open the file, and return the path if
1509 * we succeed and it's a regular file.
1510 */
1511 NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, result, td);
1512 flags = FREAD;
1513 error = vn_open(&nd, &flags, 0, -1);
1513 error = vn_open(&nd, &flags, 0, NULL);
1514 if (error == 0) {
1515 vfslocked = NDHASGIANT(&nd);
1516 NDFREE(&nd, NDF_ONLY_PNBUF);
1517 type = nd.ni_vp->v_type;
1518 if (vap)
1519 VOP_GETATTR(nd.ni_vp, vap, td->td_ucred, td);
1520 VOP_UNLOCK(nd.ni_vp, 0, td);
1521 vn_close(nd.ni_vp, FREAD, td->td_ucred, td);

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

1556 reclen = imax(modnamelen, strlen(linker_hintfile)) + pathlen +
1557 strlen(sep) + 1;
1558 pathbuf = malloc(reclen, M_LINKER, M_WAITOK);
1559 snprintf(pathbuf, reclen, "%.*s%s%s", pathlen, path, sep,
1560 linker_hintfile);
1561
1562 NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, pathbuf, td);
1563 flags = FREAD;
1514 if (error == 0) {
1515 vfslocked = NDHASGIANT(&nd);
1516 NDFREE(&nd, NDF_ONLY_PNBUF);
1517 type = nd.ni_vp->v_type;
1518 if (vap)
1519 VOP_GETATTR(nd.ni_vp, vap, td->td_ucred, td);
1520 VOP_UNLOCK(nd.ni_vp, 0, td);
1521 vn_close(nd.ni_vp, FREAD, td->td_ucred, td);

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

1556 reclen = imax(modnamelen, strlen(linker_hintfile)) + pathlen +
1557 strlen(sep) + 1;
1558 pathbuf = malloc(reclen, M_LINKER, M_WAITOK);
1559 snprintf(pathbuf, reclen, "%.*s%s%s", pathlen, path, sep,
1560 linker_hintfile);
1561
1562 NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, pathbuf, td);
1563 flags = FREAD;
1564 error = vn_open(&nd, &flags, 0, -1);
1564 error = vn_open(&nd, &flags, 0, NULL);
1565 if (error)
1566 goto bad;
1567 vfslocked = NDHASGIANT(&nd);
1568 NDFREE(&nd, NDF_ONLY_PNBUF);
1569 if (nd.ni_vp->v_type != VREG)
1570 goto bad;
1571 best = cp = NULL;
1572 error = VOP_GETATTR(nd.ni_vp, &vattr, cred, td);

--- 418 unchanged lines hidden ---
1565 if (error)
1566 goto bad;
1567 vfslocked = NDHASGIANT(&nd);
1568 NDFREE(&nd, NDF_ONLY_PNBUF);
1569 if (nd.ni_vp->v_type != VREG)
1570 goto bad;
1571 best = cp = NULL;
1572 error = VOP_GETATTR(nd.ni_vp, &vattr, cred, td);

--- 418 unchanged lines hidden ---