diff options
Diffstat (limited to 'compat/dbmopen.c')
-rw-r--r-- | compat/dbmopen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compat/dbmopen.c b/compat/dbmopen.c index 9e66acc..0125903 100644 --- a/compat/dbmopen.c +++ b/compat/dbmopen.c @@ -104,7 +104,7 @@ ndbm_open_dir_file0 (const char *file_name, int pagfd, int mode) } else { - fd = open (file_name, O_RDWR); + fd = open (file_name, mode == GDBM_READER ? O_RDONLY : O_RDWR); if (fd == -1) { gdbm_errno = GDBM_FILE_OPEN_ERROR; |