diff options
author | Bruce A. Mah <bmah@es.net> | 2014-06-09 13:41:30 -0700 |
---|---|---|
committer | Bruce A. Mah <bmah@es.net> | 2014-06-09 13:41:30 -0700 |
commit | c5e1205e4906173d74574e30b4ea1c0e182883de (patch) | |
tree | 7198d9a1cb1cb53c256499664f7cb36359699bdc /src/iperf_api.c | |
parent | 2aed949ece795ee4ee02401cf7a11a60f46fdff7 (diff) | |
download | iperf3-c5e1205e4906173d74574e30b4ea1c0e182883de.tar.gz |
Fix build on Fedora 21.
An open(2) call had two arguments instead of the required three.
While here, replace a hard-coded mode in a different open(2) call
with symbolic constants for readability.
Fixes #183.
Submitted by @ssahani.
Diffstat (limited to 'src/iperf_api.c')
-rw-r--r-- | src/iperf_api.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/iperf_api.c b/src/iperf_api.c index 18481f4..0b371f0 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -2470,7 +2470,7 @@ iperf_new_stream(struct iperf_test *test, int s) sp->rcv = test->protocol->recv; if (test->diskfile_name != (char*) 0) { - sp->diskfile_fd = open(test->diskfile_name, test->sender ? O_RDONLY : (O_WRONLY|O_CREAT|O_TRUNC)); + sp->diskfile_fd = open(test->diskfile_name, test->sender ? O_RDONLY : (O_WRONLY|O_CREAT|O_TRUNC), S_IRUSR|S_IWUSR); if (sp->diskfile_fd == -1) { i_errno = IEFILE; munmap(sp->buffer, sp->test->settings->blksize); @@ -2644,7 +2644,7 @@ iperf_create_pidfile(struct iperf_test *test) if (test->pidfile) { int fd; char buf[8]; - fd = open(test->pidfile, O_WRONLY | O_CREAT | O_TRUNC, 0666); + fd = open(test->pidfile, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR|S_IWUSR); if (fd < 0) { return -1; } |