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 /qcache.c | |
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
Diffstat (limited to 'qcache.c')
-rw-r--r-- | qcache.c | 8 |
1 files changed, 4 insertions, 4 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; |