Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
c056a910
Commit
c056a910
authored
Aug 06, 2014
by
Mike Hibler
Browse files
Add O_TRUNC to the open call for the image we are uploading.
parent
45fd4ae2
Changes
1
Hide whitespace changes
Inline
Side-by-side
clientside/os/frisbee.redux/frisuploader.c
View file @
c056a910
...
...
@@ -70,8 +70,8 @@ main(int argc, char **argv)
net_init
();
FrisLog
(
"%s: listening on port %d for image data from %s (max of %llu bytes)"
,
path
,
portnum
,
inet_ntoa
(
clientip
),
maxsize
);
FrisLog
(
"%s: listening
as %d/%d
on port %d for image data from %s (max of %llu bytes)"
,
path
,
geteuid
(),
getegid
(),
portnum
,
inet_ntoa
(
clientip
),
maxsize
);
if
(
idletimeout
||
timeout
)
FrisLog
(
"%s: using idletimeout=%ds, timeout=%ds
\n
"
,
path
,
idletimeout
,
timeout
);
...
...
@@ -233,7 +233,7 @@ recv_file()
if
(
strcmp
(
path
,
"-"
)
==
0
)
fd
=
STDOUT_FILENO
;
else
fd
=
open
(
path
,
O_WRONLY
|
O_CREAT
,
0644
);
fd
=
open
(
path
,
O_WRONLY
|
O_CREAT
|
O_TRUNC
,
0644
);
if
(
fd
<
0
)
{
FrisPwarning
(
path
);
goto
done
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment