diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-11-04 09:52:19 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-11-04 09:52:19 +0200 |
commit | dc06dca3b99f809f826f25565ace384b54f3b488 (patch) | |
tree | 7326173f77878cb23ac0ac55e546ea95a4961795 /lib/rpmdb.c | |
parent | 759b73a4293e56209e922bf58d7028234e854338 (diff) | |
download | rpm-dc06dca3b99f809f826f25565ace384b54f3b488.tar.gz rpm-dc06dca3b99f809f826f25565ace384b54f3b488.tar.bz2 rpm-dc06dca3b99f809f826f25565ace384b54f3b488.zip |
Use more portable file access mode tests (ticket #5)
- don't make assumptions about how O_RDWR and friends are defined, use the
portable way of masking flags with O_ACCMODE and explicit comparison
against the mode we're interested in
Diffstat (limited to 'lib/rpmdb.c')
-rw-r--r-- | lib/rpmdb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rpmdb.c b/lib/rpmdb.c index bde76eb21..78a97b21e 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -910,7 +910,7 @@ static int openDatabase(const char * prefix, if (dbp) *dbp = NULL; - if (mode & O_WRONLY) + if ((mode & O_ACCMODE) == O_WRONLY) return 1; db = newRpmdb(prefix, dbpath, mode, perms, flags); |