mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-04-19 18:26:32 +02:00
(touch): Call close only if necessary.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* touch -- change modification and access times of files
|
||||
Copyright (C) 87, 1989-1991, 1995-2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 87, 1989-1991, 1995-2003 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -169,7 +169,8 @@ touch (const char *file)
|
||||
error (0, errno, _("failed to get attributes of %s"),
|
||||
quote (file));
|
||||
}
|
||||
close (fd);
|
||||
if (fd != -1)
|
||||
close (fd);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user