Gentoo Archives: gentoo-commits

From: "Daniel Gryniewicz (dang)" <dang@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-admin/logrotate/files: logrotate-3.7.9-no-cloexec.patch
Date: Fri, 29 Apr 2011 00:03:11
Message-Id: 20110429000301.3A9F82004B@flycatcher.gentoo.org
1 dang 11/04/29 00:03:00
2
3 Added: logrotate-3.7.9-no-cloexec.patch
4 Log:
5 Fix bug #365137: allow to build on systems without O_CLOEXEC
6
7 (Portage version: 2.2.0_alpha30/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 app-admin/logrotate/files/logrotate-3.7.9-no-cloexec.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.7.9-no-cloexec.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/logrotate/files/logrotate-3.7.9-no-cloexec.patch?rev=1.1&content-type=text/plain
14
15 Index: logrotate-3.7.9-no-cloexec.patch
16 ===================================================================
17 diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN logrotate-3.7.9.orig//config.c logrotate-3.7.9/config.c
18 --- logrotate-3.7.9.orig//config.c 2010-06-28 04:04:56.000000000 -0400
19 +++ logrotate-3.7.9/config.c 2011-04-28 19:16:55.422051174 -0400
20 @@ -514,12 +514,19 @@ static int readConfigFile(const char *co
21 .l_whence = SEEK_SET,
22 .l_type = F_RDLCK
23 };
24 + int flags;
25
26 /* FIXME: createOwner and createGroup probably shouldn't be fixed
27 length arrays -- of course, if we aren't run setuid it doesn't
28 matter much */
29
30 - fd = open(configFile, O_RDONLY | O_CLOEXEC);
31 +#ifdef O_CLOEXEC
32 + flags = O_RDONLY | O_CLOEXEC;
33 +#else
34 + flags = O_RDONLY;
35 +#endif
36 +
37 + fd = open(configFile, flags);
38 if (fd < 0) {
39 message(MESS_ERROR, "failed to open config file %s: %s\n",
40 configFile, strerror(errno));