bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug? in gdbm_open (gdbm-1.8)


From: Hiroshi Kubota
Subject: Bug? in gdbm_open (gdbm-1.8)
Date: Wed, 30 Jan 2002 17:02:38 +0900

Dear Sirs,

I found that gdbm_open function cannot open the data file in "append only"
mode.
Isn't it a bug?

Here is the related source code in gdbmopen.c (gdbm-1.8.0) around line 130.

  switch (flags & GDBM_OPENMASK)
    {
      case GDBM_READER:
        dbf->desc = open (dbf->name, O_RDONLY, 0);
        break;

      case GDBM_OPENMASK:
        dbf->desc = open (dbf->name, O_RDWR, 0);
        break;

      case GDBM_NEWDB:
        dbf->desc = open (dbf->name, O_RDWR|O_CREAT, mode);
        flags = GDBM_WRITER;
        need_trunc = TRUE;
        break;

      default:
        dbf->desc = open (dbf->name, O_RDWR|O_CREAT, mode);
        flags = GDBM_WRITER;
        break;

    }

I suppose the second case branch should be "case GDBM_WRITER:" instead of
GDBM_OPENMASK.

-- 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]