diff options
author | Bruce Momjian <bruce@momjian.us> | 2004-03-18 04:11:41 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2004-03-18 04:11:41 +0000 |
commit | 69138a9429531123bf86dfabbc169bb30a6ae32b (patch) | |
tree | 37f3a3aa23a722643e6e983f5bfb4274810ab95d /src | |
parent | bfaa9a0ada5119bd6b440a88121da15e406365dd (diff) | |
download | postgresql-69138a9429531123bf86dfabbc169bb30a6ae32b.tar.gz postgresql-69138a9429531123bf86dfabbc169bb30a6ae32b.zip |
Add permission mode to opens().
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/fsync/test_fsync.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/fsync/test_fsync.c b/src/tools/fsync/test_fsync.c index 3905d2b1575..c3ec77ba515 100644 --- a/src/tools/fsync/test_fsync.c +++ b/src/tools/fsync/test_fsync.c @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) printf("Simple write timing:\n"); /* write only */ gettimeofday(&start_t, NULL); - if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT)) == -1) + if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT, 0600)) == -1) die("can't open /var/tmp/test_fsync.out"); write(tmpfile, &strout, 200); close(tmpfile); @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) printf("Compare fsync before and after write's close:\n"); /* write, fsync, close */ gettimeofday(&start_t, NULL); - if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT)) == -1) + if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT, 0600)) == -1) die("can't open /var/tmp/test_fsync.out"); write(tmpfile, &strout, 200); fsync(tmpfile); @@ -65,12 +65,12 @@ int main(int argc, char *argv[]) /* write, close, fsync */ gettimeofday(&start_t, NULL); - if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT)) == -1) + if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT, 0600)) == -1) die("can't open /var/tmp/test_fsync.out"); write(tmpfile, &strout, 200); close(tmpfile); /* reopen file */ - if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT)) == -1) + if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT, 0600)) == -1) die("can't open /var/tmp/test_fsync.out"); fsync(tmpfile); close(tmpfile); @@ -85,7 +85,7 @@ int main(int argc, char *argv[]) #ifdef OPEN_DATASYNC_FLAG /* open_dsync, write */ gettimeofday(&start_t, NULL); - if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT | O_DSYNC)) == -1) + if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT | O_DSYNC, 0600)) == -1) die("can't open /var/tmp/test_fsync.out"); write(tmpfile, &strout, 200); close(tmpfile); @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) /* open_fsync, write */ gettimeofday(&start_t, NULL); - if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT | OPEN_SYNC_FLAG)) == -1) + if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT | OPEN_SYNC_FLAG, 0600)) == -1) die("can't open /var/tmp/test_fsync.out"); write(tmpfile, &strout, 200); close(tmpfile); @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) #ifdef HAVE_FDATASYNC /* write, fdatasync */ gettimeofday(&start_t, NULL); - if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT)) == -1) + if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT, 0600)) == -1) die("can't open /var/tmp/test_fsync.out"); write(tmpfile, &strout, 200); fdatasync(tmpfile); @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) /* write, fsync, close */ gettimeofday(&start_t, NULL); - if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT)) == -1) + if ((tmpfile = open("/var/tmp/test_fsync.out", O_RDWR | O_CREAT, 0600)) == -1) die("can't open /var/tmp/test_fsync.out"); write(tmpfile, &strout, 200); fsync(tmpfile); |