1
1
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.
Этот коммит содержится в:
Bruce A. Mah 2014-06-09 13:41:30 -07:00
родитель 2aed949ece
Коммит c5e1205e49
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4984910A8CAAEE8A

Просмотреть файл

@ -2470,7 +2470,7 @@ iperf_new_stream(struct iperf_test *test, int s)
sp->rcv = test->protocol->recv; sp->rcv = test->protocol->recv;
if (test->diskfile_name != (char*) 0) { 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) { if (sp->diskfile_fd == -1) {
i_errno = IEFILE; i_errno = IEFILE;
munmap(sp->buffer, sp->test->settings->blksize); munmap(sp->buffer, sp->test->settings->blksize);
@ -2644,7 +2644,7 @@ iperf_create_pidfile(struct iperf_test *test)
if (test->pidfile) { if (test->pidfile) {
int fd; int fd;
char buf[8]; 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) { if (fd < 0) {
return -1; return -1;
} }