aboutsummaryrefslogtreecommitdiff
path: root/src/iperf_api.c
diff options
context:
space:
mode:
authorBruce A. Mah <bmah@es.net>2014-06-09 13:41:30 -0700
committerBruce A. Mah <bmah@es.net>2014-06-09 13:41:30 -0700
commitc5e1205e4906173d74574e30b4ea1c0e182883de (patch)
tree7198d9a1cb1cb53c256499664f7cb36359699bdc /src/iperf_api.c
parent2aed949ece795ee4ee02401cf7a11a60f46fdff7 (diff)
downloadiperf3-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.c4
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;
}