diff options
author | Mike Frysinger <vapier@gentoo.org> | 2014-01-07 19:48:45 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2014-01-07 19:48:45 +0000 |
commit | 4d597a585db0fa017b373d2e096906b3df85fee3 (patch) | |
tree | e9fb1b2880a50682699a997b6f1e8d03ef0b3431 | |
parent | delete O_CLOEXEC fallback logic as porting.h already does this (diff) | |
download | portage-utils-4d597a585db0fa017b373d2e096906b3df85fee3.tar.gz portage-utils-4d597a585db0fa017b373d2e096906b3df85fee3.tar.bz2 portage-utils-4d597a585db0fa017b373d2e096906b3df85fee3.zip |
qcache/qcheck: use O_CLOEXEC in more places
-rw-r--r-- | qcache.c | 8 | ||||
-rw-r--r-- | qcheck.c | 6 |
2 files changed, 7 insertions, 7 deletions
@@ -1,7 +1,7 @@ /* * Copyright 2005-2010 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcache.c,v 1.46 2013/09/29 18:40:22 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcache.c,v 1.47 2014/01/07 19:48:45 vapier Exp $ * * Copyright 2006 Thomas A. Cort - <tcort@gentoo.org> */ @@ -47,7 +47,7 @@ static const char * const qcache_opts_help[] = { COMMON_OPTS_HELP }; -static const char qcache_rcsid[] = "$Id: qcache.c,v 1.46 2013/09/29 18:40:22 vapier Exp $"; +static const char qcache_rcsid[] = "$Id: qcache.c,v 1.47 2014/01/07 19:48:45 vapier Exp $"; #define qcache_usage(ret) usage(ret, QCACHE_FLAGS, qcache_long_opts, qcache_opts_help, lookup_applet_idx("qcache")) /********************************************************************/ @@ -236,7 +236,7 @@ static unsigned int qcache_count_lines(char *filename) int count, fd; char c; - if ((fd = open(filename, O_RDONLY)) != -1) { + if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) != -1) { count = 0; while (read(fd, &c, 1) == 1) @@ -274,7 +274,7 @@ char **qcache_read_lines(char *filename) len = sizeof(char*) * (num_lines + 1); lines = xzalloc(len); - if ((fd = open(filename, O_RDONLY)) != -1) { + if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) != -1) { for (i = 0; i < num_lines; i++) { count = 0; @@ -1,7 +1,7 @@ /* * Copyright 2005-2011 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcheck.c,v 1.58 2013/04/21 04:28:10 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcheck.c,v 1.59 2014/01/07 19:48:45 vapier Exp $ * * Copyright 2005-2010 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2011 Mike Frysinger - <vapier@gentoo.org> @@ -36,7 +36,7 @@ static const char * const qcheck_opts_help[] = { "Undo prelink when calculating checksums", COMMON_OPTS_HELP }; -static const char qcheck_rcsid[] = "$Id: qcheck.c,v 1.58 2013/04/21 04:28:10 vapier Exp $"; +static const char qcheck_rcsid[] = "$Id: qcheck.c,v 1.59 2014/01/07 19:48:45 vapier Exp $"; #define qcheck_usage(ret) usage(ret, QCHECK_FLAGS, qcheck_long_opts, qcheck_opts_help, lookup_applet_idx("qcheck")) #define qcprintf(fmt, args...) if (!state->bad_only) printf(_(fmt), ## args) @@ -71,7 +71,7 @@ static int qcheck_process_contents(q_vdb_pkg_ctx *pkg_ctx, struct qcheck_opt_sta fpx = NULL; - fd = q_vdb_pkg_openat(pkg_ctx, "CONTENTS", O_RDONLY); + fd = q_vdb_pkg_openat(pkg_ctx, "CONTENTS", O_RDONLY|O_CLOEXEC); if (fd == -1) return EXIT_SUCCESS; if (fstat(fd, &cst)) { |