diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-11-04 08:39:57 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-11-04 08:39:57 +0000 |
| commit | fbf1b1ead9323a7f5909f483c137c46f65d3f68c (patch) | |
| tree | 9976842c343a888dc34f5cc53ecedc5abb358669 /ext/dbm | |
| parent | 9868574ae43c0fdc49a9d3fc0431bb0613507bfa (diff) | |
| download | ruby-fbf1b1ead9323a7f5909f483c137c46f65d3f68c.tar.gz ruby-fbf1b1ead9323a7f5909f483c137c46f65d3f68c.tar.xz ruby-fbf1b1ead9323a7f5909f483c137c46f65d3f68c.zip | |
19991104
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dbm')
| -rw-r--r-- | ext/dbm/dbm.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c index 4d83cec1b..1240f4b9a 100644 --- a/ext/dbm/dbm.c +++ b/ext/dbm/dbm.c @@ -72,12 +72,16 @@ fdbm_s_open(argc, argv, klass) Check_SafeStr(file); dbm = 0; - if (mode >= 0) + if (mode >= 0) { dbm = dbm_open(RSTRING(file)->ptr, O_RDWR|O_CREAT, mode); - if (!dbm) + } + if (!dbm) { + mode = 0666; dbm = dbm_open(RSTRING(file)->ptr, O_RDWR, mode); - if (!dbm) + } + if (!dbm) { dbm = dbm_open(RSTRING(file)->ptr, O_RDONLY, mode); + } if (!dbm) { if (mode == -1) return Qnil; |
