Page MenuHomeFreeBSD

D55117.id.diff
No OneTemporary

D55117.id.diff

diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c
--- a/usr.bin/touch/touch.c
+++ b/usr.bin/touch/touch.c
@@ -163,19 +163,14 @@
/* Create the file. */
fd = open(*argv,
O_WRONLY | O_CREAT, DEFFILEMODE);
- if (fd == -1) {
+ if (fd < 0 || fstat(fd, &sb) < 0) {
rval = 1;
warn("%s", *argv);
+ if (fd >= 0)
+ (void)close(fd);
continue;
}
- if (fstat(fd, &sb) < 0) {
- warn("%s", *argv);
- rval = 1;
- }
- if (close(fd) < 0) {
- warn("%s", *argv);
- rval = 1;
- }
+ (void)close(fd);
/* If using the current time, we're done. */
if (!timeset)

File Metadata

Mime Type
text/plain
Expires
Wed, Jul 22, 2:05 PM (15 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35218026
Default Alt Text
D55117.id.diff (646 B)

Event Timeline