kern_linker.c (677b542ea243380af64822b30e4ef5f7a6d978ee) | kern_linker.c (7c89f162bcb645d2fdb234883fb689ed896077a2) |
---|---|
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 --- 1378 unchanged lines hidden (view full) --- 1387 snprintf(result, reclen, "%.*s%s%.*s%s", pathlen, path, sep, 1388 namelen, name, *cpp); 1389 /* 1390 * Attempt to open the file, and return the path if 1391 * we succeed and it's a regular file. 1392 */ 1393 NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, result, td); 1394 flags = FREAD; | 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 --- 1378 unchanged lines hidden (view full) --- 1387 snprintf(result, reclen, "%.*s%s%.*s%s", pathlen, path, sep, 1388 namelen, name, *cpp); 1389 /* 1390 * Attempt to open the file, and return the path if 1391 * we succeed and it's a regular file. 1392 */ 1393 NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, result, td); 1394 flags = FREAD; |
1395 error = vn_open(&nd, &flags, 0); | 1395 error = vn_open(&nd, &flags, 0, -1); |
1396 if (error == 0) { 1397 NDFREE(&nd, NDF_ONLY_PNBUF); 1398 type = nd.ni_vp->v_type; 1399 if (vap) 1400 VOP_GETATTR(nd.ni_vp, vap, td->td_ucred, td); 1401 VOP_UNLOCK(nd.ni_vp, 0, td); 1402 vn_close(nd.ni_vp, FREAD, td->td_ucred, td); 1403 if (type == VREG) --- 31 unchanged lines hidden (view full) --- 1435 reclen = imax(modnamelen, strlen(linker_hintfile)) + pathlen + 1436 strlen(sep) + 1; 1437 pathbuf = malloc(reclen, M_LINKER, M_WAITOK); 1438 snprintf(pathbuf, reclen, "%.*s%s%s", pathlen, path, sep, 1439 linker_hintfile); 1440 1441 NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, pathbuf, td); 1442 flags = FREAD; | 1396 if (error == 0) { 1397 NDFREE(&nd, NDF_ONLY_PNBUF); 1398 type = nd.ni_vp->v_type; 1399 if (vap) 1400 VOP_GETATTR(nd.ni_vp, vap, td->td_ucred, td); 1401 VOP_UNLOCK(nd.ni_vp, 0, td); 1402 vn_close(nd.ni_vp, FREAD, td->td_ucred, td); 1403 if (type == VREG) --- 31 unchanged lines hidden (view full) --- 1435 reclen = imax(modnamelen, strlen(linker_hintfile)) + pathlen + 1436 strlen(sep) + 1; 1437 pathbuf = malloc(reclen, M_LINKER, M_WAITOK); 1438 snprintf(pathbuf, reclen, "%.*s%s%s", pathlen, path, sep, 1439 linker_hintfile); 1440 1441 NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, pathbuf, td); 1442 flags = FREAD; |
1443 error = vn_open(&nd, &flags, 0); | 1443 error = vn_open(&nd, &flags, 0, -1); |
1444 if (error) 1445 goto bad; 1446 NDFREE(&nd, NDF_ONLY_PNBUF); 1447 if (nd.ni_vp->v_type != VREG) 1448 goto bad; 1449 best = cp = NULL; 1450 error = VOP_GETATTR(nd.ni_vp, &vattr, cred, td); 1451 if (error) --- 363 unchanged lines hidden --- | 1444 if (error) 1445 goto bad; 1446 NDFREE(&nd, NDF_ONLY_PNBUF); 1447 if (nd.ni_vp->v_type != VREG) 1448 goto bad; 1449 best = cp = NULL; 1450 error = VOP_GETATTR(nd.ni_vp, &vattr, cred, td); 1451 if (error) --- 363 unchanged lines hidden --- |