From: Ulrich Drepper Date: Sat, 26 Jul 2008 22:35:15 +0000 (+0000) Subject: * login/utmp_file.c (setutent_file): Minor optimization in case X-Git-Tag: cvs/fedora-glibc-20080728T2320~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7438a80dcbb3c6766fe0288935c545c6a0f98257;p=thirdparty%2Fglibc.git * login/utmp_file.c (setutent_file): Minor optimization in case O_CLOEXEC is available. --- diff --git a/ChangeLog b/ChangeLog index eabfcb5c50c..c58664c14a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-26 Ulrich Drepper + + * login/utmp_file.c (setutent_file): Minor optimization in case + O_CLOEXEC is available. + 2008-07-24 Tom "spot" Callaway * Makeconfig: Define pie-ccflag and PIE-ccflag variables. diff --git a/login/utmp_file.c b/login/utmp_file.c index a1c6a257167..c0bd2299522 100644 --- a/login/utmp_file.c +++ b/login/utmp_file.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2002, 2003, 2004, 2007 Free Software Foundation, Inc. +/* Copyright (C) 1996-2004, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper and Paul Janzen , 1996. @@ -167,10 +167,11 @@ setutent_file (void) # ifdef O_CLOEXEC if (__have_o_cloexec == 0) __have_o_cloexec = (result & FD_CLOEXEC) ? 1 : -1; -# endif - result = fcntl_not_cancel (file_fd, F_SETFD, - result | FD_CLOEXEC); + if (__have_o_cloexec < 0) +# endif + result = fcntl_not_cancel (file_fd, F_SETFD, + result | FD_CLOEXEC); } if (result == -1)