nlist.c (200150) | nlist.c (241046) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. 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 --- 17 unchanged lines hidden (view full) --- 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#if defined(LIBC_SCCS) && !defined(lint) 31static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93"; 32#endif /* LIBC_SCCS and not lint */ 33#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. 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 --- 17 unchanged lines hidden (view full) --- 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#if defined(LIBC_SCCS) && !defined(lint) 31static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93"; 32#endif /* LIBC_SCCS and not lint */ 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/lib/libc/gen/nlist.c 200150 2009-12-05 19:31:38Z ed $"); | 34__FBSDID("$FreeBSD: head/lib/libc/gen/nlist.c 241046 2012-09-29 11:54:34Z jilles $"); |
35 36#include "namespace.h" 37#include <sys/param.h> 38#include <sys/mman.h> 39#include <sys/stat.h> 40#include <sys/file.h> 41#include <arpa/inet.h> 42 --- 18 unchanged lines hidden (view full) --- 61 62int 63nlist(name, list) 64 const char *name; 65 struct nlist *list; 66{ 67 int fd, n; 68 | 35 36#include "namespace.h" 37#include <sys/param.h> 38#include <sys/mman.h> 39#include <sys/stat.h> 40#include <sys/file.h> 41#include <arpa/inet.h> 42 --- 18 unchanged lines hidden (view full) --- 61 62int 63nlist(name, list) 64 const char *name; 65 struct nlist *list; 66{ 67 int fd, n; 68 |
69 fd = _open(name, O_RDONLY, 0); | 69 fd = _open(name, O_RDONLY | O_CLOEXEC, 0); |
70 if (fd < 0) 71 return (-1); 72 n = __fdnlist(fd, list); 73 (void)_close(fd); 74 return (n); 75} 76 77static struct nlist_handlers { --- 334 unchanged lines hidden --- | 70 if (fd < 0) 71 return (-1); 72 n = __fdnlist(fd, list); 73 (void)_close(fd); 74 return (n); 75} 76 77static struct nlist_handlers { --- 334 unchanged lines hidden --- |