Page MenuHomeFreeBSD

D55117.diff
No OneTemporary

D55117.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
Sat, Jul 25, 8:33 PM (21 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35489725
Default Alt Text
D55117.diff (646 B)

Event Timeline