Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144360330
D48196.id148375.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
826 B
Referenced Files
None
Subscribers
None
D48196.id148375.diff
View Options
diff --git a/usr.bin/tee/tee.c b/usr.bin/tee/tee.c
--- a/usr.bin/tee/tee.c
+++ b/usr.bin/tee/tee.c
@@ -60,7 +60,7 @@
struct entry *p;
int n, fd, rval, wval;
char *bp;
- int append, ch, exitval;
+ int append, ch, exitval, omode;
char *buf;
#define BSIZE (8 * 1024)
@@ -88,13 +88,19 @@
add(STDOUT_FILENO, "stdout");
- for (exitval = 0; *argv; ++argv)
- if ((fd = open(*argv, append ? O_WRONLY|O_CREAT|O_APPEND :
- O_WRONLY|O_CREAT|O_TRUNC, DEFFILEMODE)) < 0) {
+ omode = O_WRONLY | O_CREAT;
+ if (append)
+ omode |= O_APPEND;
+ else
+ omode |= O_TRUNC;
+
+ for (exitval = 0; *argv; ++argv) {
+ if ((fd = open(*argv, omode, DEFFILEMODE)) < 0) {
warn("%s", *argv);
exitval = 1;
} else
add(fd, *argv);
+ }
if (caph_enter() < 0)
err(EXIT_FAILURE, "unable to enter capability mode");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 1:16 AM (10 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28519708
Default Alt Text
D48196.id148375.diff (826 B)
Attached To
Mode
D48196: tee: minor cleanup
Attached
Detach File
Event Timeline
Log In to Comment