[svn-r16167] Bug fix: 1089

Description:
One open() call with O_CREAT flag did not have the third required argument.

Solution:
Added the right third argument. Also changed all open() calls to HDopen
macros for more portable coding.

Tested:
h5committested.
This commit is contained in:
Albert Cheng 2008-12-08 21:28:05 -05:00
parent 58090002a8
commit 064fee6e8e

View File

@ -436,7 +436,7 @@ fill_with_random_data(Bytef *src, uLongf src_len)
if (stat("/dev/urandom", &stat_buf) == 0) {
uLongf len = src_len;
Bytef *buf = src;
int fd = open("/dev/urandom", O_RDONLY);
int fd = HDopen("/dev/urandom", O_RDONLY, 0);
printf("Using /dev/urandom for random data\n");
@ -510,7 +510,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size,
/* do uncompressed data write */
gettimeofday(&timer_start, NULL);
output = open(filename, O_RDWR | O_CREAT, S_IRWXU);
output = HDopen(filename, O_RDWR | O_CREAT, S_IRWXU);
if (output == -1)
error(strerror(errno));
@ -549,7 +549,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size,
unlink(filename);
/* do compressed data write */
output = open(filename, O_RDWR | O_CREAT);
output = HDopen(filename, O_RDWR | O_CREAT, S_IRWXU);
if (output == -1)
error(strerror(errno));