@@ -39,7 +39,7 @@ int main(int argc, char *argv[])
3939printf ("Simple write timing:\n" );
4040/* write only */
4141gettimeofday (& start_t ,NULL );
42- if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT ))== -1 )
42+ if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT , 0600 ))== -1 )
4343die ("can't open /var/tmp/test_fsync.out" );
4444write (tmpfile ,& strout ,200 );
4545close (tmpfile );
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
5252printf ("Compare fsync before and after write's close:\n" );
5353/* write, fsync, close */
5454gettimeofday (& start_t ,NULL );
55- if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT ))== -1 )
55+ if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT , 0600 ))== -1 )
5656die ("can't open /var/tmp/test_fsync.out" );
5757write (tmpfile ,& strout ,200 );
5858fsync (tmpfile );
@@ -65,12 +65,12 @@ int main(int argc, char *argv[])
6565
6666/* write, close, fsync */
6767gettimeofday (& start_t ,NULL );
68- if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT ))== -1 )
68+ if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT , 0600 ))== -1 )
6969die ("can't open /var/tmp/test_fsync.out" );
7070write (tmpfile ,& strout ,200 );
7171close (tmpfile );
7272/* reopen file */
73- if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT ))== -1 )
73+ if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT , 0600 ))== -1 )
7474die ("can't open /var/tmp/test_fsync.out" );
7575fsync (tmpfile );
7676close (tmpfile );
@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
8585#ifdef OPEN_DATASYNC_FLAG
8686/* open_dsync, write */
8787gettimeofday (& start_t ,NULL );
88- if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT |O_DSYNC ))== -1 )
88+ if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT |O_DSYNC , 0600 ))== -1 )
8989die ("can't open /var/tmp/test_fsync.out" );
9090write (tmpfile ,& strout ,200 );
9191close (tmpfile );
@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
9898
9999/* open_fsync, write */
100100gettimeofday (& start_t ,NULL );
101- if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT |OPEN_SYNC_FLAG ))== -1 )
101+ if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT |OPEN_SYNC_FLAG , 0600 ))== -1 )
102102die ("can't open /var/tmp/test_fsync.out" );
103103write (tmpfile ,& strout ,200 );
104104close (tmpfile );
@@ -111,7 +111,7 @@ int main(int argc, char *argv[])
111111#ifdef HAVE_FDATASYNC
112112/* write, fdatasync */
113113gettimeofday (& start_t ,NULL );
114- if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT ))== -1 )
114+ if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT , 0600 ))== -1 )
115115die ("can't open /var/tmp/test_fsync.out" );
116116write (tmpfile ,& strout ,200 );
117117fdatasync (tmpfile );
@@ -125,7 +125,7 @@ int main(int argc, char *argv[])
125125
126126/* write, fsync, close */
127127gettimeofday (& start_t ,NULL );
128- if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT ))== -1 )
128+ if ((tmpfile = open ("/var/tmp/test_fsync.out" ,O_RDWR |O_CREAT , 0600 ))== -1 )
129129die ("can't open /var/tmp/test_fsync.out" );
130130write (tmpfile ,& strout ,200 );
131131fsync (tmpfile );