bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

touch - a small optim


From: Bruno Haible
Subject: touch - a small optim
Date: Tue, 27 May 2003 13:31:37 +0200 (CEST)

This patch removes a useless system call (close(-1)) in some cases.

diff -r -c3 coreutils-5.0/src/touch.c coreutils-5.0-touch/src/touch.c
*** coreutils-5.0/src/touch.c   2002-12-20 21:09:22.000000000 +0100
--- coreutils-5.0-touch/src/touch.c     2003-05-25 21:39:54.000000000 +0200
***************
*** 169,175 ****
              error (0, errno, _("failed to get attributes of %s"),
                     quote (file));
            }
!         close (fd);
          return 1;
        }
      }
--- 219,226 ----
              error (0, errno, _("failed to get attributes of %s"),
                     quote (file));
            }
!         if (fd != -1)
!           close (fd);
          return 1;
        }
      }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]