summaryrefslogtreecommitdiff
path: root/compat
Commit message (Collapse)AuthorAgeFilesLines
* Minor fix in the compatibility library.HEADmasterSergey Poznyakoff2023-03-031-5/+21
| | | | | | * compat/dbmopen.c (ndbm_open_dir_file0): Don't try to unlink the 1.8-compatible dir file or create a missing one if the database is being opened read-only.
* Update copyright yearsSergey Poznyakoff2023-01-2220-20/+20
|
* Update copyright yearsSergey Poznyakoff2022-01-0220-20/+20
|
* Fix typosSergey Poznyakoff2021-11-185-6/+6
|
* Update copyright yearsSergey Poznyakoff2021-01-0220-37/+20
|
* Update copyright yearsSergey Poznyakoff2020-12-2320-20/+20
|
* Update copyright yearsSergey Poznyakoff2019-04-0820-20/+20
|
* Various bugfixes.Sergey Poznyakoff2018-08-311-1/+1
| | | | | | | | | | | | | | | | | | | * compat/dbmopen.c (ndbm_open_dir_file0): Ignore ENOENT. * src/falloc.c (push_avail_block): Free temporary storage no matter what return status. * src/gdbm.h.in (GDBM_FILE_TRUNCATE_ERROR): New error code. * src/gdbmdump.c (_gdbm_dump_ascii): Initialize rc. * src/gdbmerrno.c: Handle new error.code * src/gdbmload.c (gdbm_load_bdb_dump): Initialize rc * src/gdbmopen.c (_gdbm_ftruncate): New function. (gdbm_fd_open): Use _gdbm_ftruncate. Check its return. * src/gdbmseq.c (gdbm_firstkey): Initialize dsize * src/gdbmtool.c (command_generator): Check if cmd is NULL. (shouldn't happen, but anyways). * src/mmap.c (_gdbm_mapped_lseek): Check for vailidity of the 'whence' parameter. * src/systems.h (TRUNCATE): Remove macro. * src/util.c (vgetyn): Remove unnecessary assignment.
* Happy GNU YearSergey Poznyakoff2018-01-0120-21/+24
|
* Happy GNU YearSergey Poznyakoff2017-01-0220-34/+34
|
* Fix distributionSergey Poznyakoff2016-07-251-1/+1
| | | | | | * src/Makefile.am: Mark gdbm.h as noinst * compat/Makefile.am (AM_CPPFLAGS): Make sure we pick up ../src/gdbm.h
* Don't bail out on fatal errors, unless the user defines the fatal_err functionSergey Poznyakoff2016-07-092-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/bucket.c (_gdbm_get_bucket) (_gdbm_split_bucket, _gdbm_write_bucket): Return error code. All callers updated. * src/proto.h (_gdbm_get_bucket) (_gdbm_split_bucket, _gdbm_write_bucket): Update declarations * src/falloc.c (push_avail_block) (pop_avail_block): Return error code. All callers updated. * src/update.c (_gdbm_fatal): Exit only if the user defined fatal_err function. * src/gdbmerrno.c (gdbm_needs_recovery): New function. * src/gdbm.h.in (gdbm_needs_recovery): New proto. * compat/dbminit.c: Set gdbm_errno on fatal errors. * compat/dbmopen.c: Likewise. * src/findkey.c: Likewise. * src/gdbm_load.c: Likewise. * src/gdbmcount.c: Likewise. * src/gdbmdefs.h: Likewise. * src/gdbmdelete.c: Likewise. * src/gdbmdump.c: Likewise. * src/gdbmexists.c: Likewise. * src/gdbmexp.c: Likewise. * src/gdbmfetch.c: Likewise. * src/gdbmimp.c: Likewise. * src/gdbmload.c: Likewise. * src/gdbmopen.c: Likewise. * src/gdbmreorg.c: Likewise. * src/gdbmseq.c: Likewise. * src/gdbmsetopt.c: Likewise. * src/gdbmstore.c: Likewise. * src/gdbmsync.c: Likewise. * src/mmap.c: Likewise.
* All gdbm functions return immediately if the DB is in inconsistent sate ↵Sergey Poznyakoff2016-07-092-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | (needs recovery). * src/gdbm.h.in (GDBM_NEED_RECOVERY): New error code. * src/gdbmdefs.h (GDBM_ASSERT_CONSISTENCY): New macro. * src/gdbmerrno.c: Update. * src/gdbmopen.c (gdbm_open): Initialize need_recovery and last_error. * src/gdbmcount.c (gdbm_count): Return immediately if the database needs recovery. * src/gdbmdelete.c (gdbm_delete): Likewise. * src/gdbmdump.c (gdbm_dump_to_file, gdbm_dump): Likewise. * src/gdbmexists.c (gdbm_exists): Likewise. * src/gdbmexp.c (gdbm_export_to_file): Likewise. * src/gdbmfetch.c (gdbm_fetch): Likewise. * src/gdbmimp.c (gdbm_import_from_file): Likewise. * src/gdbmreorg.c (gdbm_reorganize): Likewise. * src/gdbmseq.c (gdbm_firstkey): Likewise. * src/gdbmsetopt.c (gdbm_nextkey): Likewise. * src/gdbmstore.c (gdbm_store): Likewise. * src/gdbmsync.c (gdbm_sync): Likewise.
* Per-database error state.Sergey Poznyakoff2016-07-092-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Last error code is stored in the database file structure as well as in the global gdbm_errno. Special functions are provided for retrieving and clearing the last error state. * src/gdbmdefs.h (gdbm_file_info): New member: last_error * src/gdbm.h.in (gdbm_last_errno, gdbm_set_errno) (gdbm_clear_error): New protos. * src/gdbmerrno.c (gdbm_last_errno, gdbm_set_errno) (gdbm_clear_error): New functions * NEWS: Update. * compat/dbminit.c: Use gdbm_set_errno to set error state. * compat/dbmopen.c: Likewise. * src/bucket.c: Likewise. * src/findkey.c: Likewise. * src/gdbm_load.c: Likewise. * src/gdbmcount.c: Likewise. * src/gdbmdelete.c: Likewise. * src/gdbmdump.c: Likewise. * src/gdbmexists.c: Likewise. * src/gdbmexp.c: Likewise. * src/gdbmfetch.c: Likewise. * src/gdbmimp.c: Likewise. * src/gdbmload.c: Likewise. * src/gdbmopen.c: Likewise. * src/gdbmreorg.c: Likewise. * src/gdbmseq.c: Likewise. * src/gdbmsetopt.c: Likewise. * src/gdbmstore.c: Likewise. * src/gdbmsync.c: Likewise. * src/mmap.c: Likewise.
* Switch to Git repositorySergey Poznyakoff2016-07-071-0/+0
|
* Optionally install compatibility headers into a separate directory.Sergey Poznyakoff2014-02-141-2/+3
| | | | | | | | | * configure.ac: Version 1.11.90 (COMPATINCLUDEDIR): New substitution variable. * compat/Makefile.am (compatincludedir): New variable. (include_HEADERS): Rename to compatinclude_HEADERS. * NEWS: Document COMPATINCLUDEDIR. * README: Likewise.
* Improve testgdbm; install some more bugfixes.Sergey Poznyakoff2013-05-081-2/+2
| | | | | | | | | | | | | | | * src/gdbmdefs.h: Fix typo in a comment. * src/gdbmdump.c (gdbm_dump_to_file): Improve error checking. * src/testgdbm.c: Improve interactive usage. (command) <minlen>: Rename to len. (command_tab): Initialize len. (set_minimal_abbreviations): Remove. (sort_commands): New function. (find_command): Print possible alternatives in case of ambiguous input. (main): Reset param.argc after freeing previous arguments. Continue silently if find_command returns NULL.
* Implement cloexec in gdbm_reorganize. Add test cases.Sergey Poznyakoff2011-11-111-7/+6
| | | | | | | | | | | | | | | | | | | | | | | * compat/dbmopen.c: Apply O_CLOEXEC for newly created dir file, if requested. * src/gdbmdefs.h (gdbm_file_info) <cloexec>: New member. * src/gdbmopen.c (gdbm_open): Initialize cloexec member. * src/gdbmreorg.c (gdbm_reorganize): Propagate cloexec bit to the new database. * tests/.cvsignore: Update. * tests/cloexec00.at: New test case. * tests/cloexec01.at: Likewise. * tests/cloexec02.at: Likewise. * tests/cloexec03.at: Likewise. * fdop.c: New auxiliary program. * g_open_ce: New test program. * g_reorg_ce: New test program. * d_creat_ce: New test program. * tests/Makefile.am: Add new test cases and test programs. * tests/testsuite.at: Include new test cases. * doc/gdbm.texinfo: Minor change.
* Support close-on-exec flag for gdbm_open call.Sergey Poznyakoff2011-11-111-12/+30
| | | | | | | | | | | | | | | * src/gdbm.h.in (GDBM_CLOEXEC): New flag. * src/systems.h [O_CLOEXEC]: Provide a placeholder definition. * src/gdbmopen.c (gdbm_open): Honor the GDBM_CLOEXEC flag. * compat/dbmopen.c (ndbm_open_dir_file0): Mask out open mode before comparing with GDBM_READER. Support GDBM_CLOEXEC. (dbm_open): Translate O_CLOEXEC to GDBM_CLOEXEC. * doc/gdbm.texinfo: Document GDBM_CLOEXEC. * NEWS: Update.
* Fix handling of NDBM databases in read-only mode.Sergey Poznyakoff2011-11-101-1/+1
| | | | | | | | | | * compat/dbmopen.c (ndbm_open_dir_file0): Open dir file in read-only mode if the database is being opened as GDBM_READER. * tests/dbmcvt.at: New file. * tests/dbmfetch02.at: New file. * tests/dbmfetch03.at: New file. * tests/Makefile.am (TESTSUITE_AT): Add new files. * tests/testsuite.at: Include new testcases.
* * compat/Makefile.am (libgdbm_compat_la_LIBADD): Link against libgdbm.Sergey Poznyakoff2011-08-141-0/+1
|
* Implement dbm_error and dbm_clearerr.Sergey Poznyakoff2011-08-098-11/+59
| | | | | | | | | | | | | | * compat/ndbm.h (__gdbm_error_to_ndbm): New macro (dbm_error,dbm_clearerr): Provide prototypes instead of the macros. (DBM) <_dbm_errno>: New member. * compat/dbmerr.c: New file. * compat/Makefile.am (NDBM_CF): Add dbmerr.c * compat/dbmdelete.c: Make sure _dbm_errno reflects the actual error state. * compat/dbmfetch.c: Likewise. * compat/dbmseq.c: Likewise. * compat/dbmstore.c: Likewise.
* (dbm_open): Instead of linking pag to dir, create a separate dir fileSergey Poznyakoff2011-08-061-32/+154
| | | | | | | | | with the version information in it. When opening an existing db in write mode, detect if it has pag linked to dir. If so, break the link and recreate the dir file in new format. This allows GDBM to cooperate with the applications which lock both pag and dir files.
* (dbm_dirfno): Return dirfd.Sergey Poznyakoff2011-08-061-1/+1
|
* (dbm_close): Close dirfd.Sergey Poznyakoff2011-08-061-0/+1
|
* (DBM) <dirfd>: New member.Sergey Poznyakoff2011-08-061-3/+4
|
* Include nbdm.h.Sergey Poznyakoff2011-08-0510-65/+68
| | | | Use the new DBM declaration.
* Rewrite using ndbm interface.Sergey Poznyakoff2011-08-055-120/+17
|
* (include_HEADERS): Add dbm.h and ndbm.hSergey Poznyakoff2011-08-051-0/+3
| | | | (noinst_HEADERS): Add dbm-priv.h
* New file.Sergey Poznyakoff2011-08-053-0/+115
|
* Update copyright headers.Sergey Poznyakoff2011-08-0316-76/+74
|
* Update cvsignore files.Sergey Poznyakoff2011-08-021-0/+3
|
* Update.Sergey Poznyakoff2011-08-021-0/+1
|
* Remove useless includes.Sergey Poznyakoff2011-08-012-2/+0
|
* Use GDBM_FILE instead of gdbm_file_info *.Sergey Poznyakoff2011-08-019-17/+22
|
* Add .cvsignore filesSergey Poznyakoff2008-12-031-0/+2
|
* Kill generated filesJason Downs2008-12-011-526/+0
|
* The library was not working on Solaris due to file locking. fcntl locks areJason Downs2008-11-301-88/+88
| | | | | | | | | | | | | | | | | | | | | not working over NFS at all. They also need to be changed to use flock64 structs, which has been done. File locking needs to be refactored within the library. We likely need to add lockf support, and use a better method for determining which locking type to use (our current method is to just make assumptions). testgdbm now builds on Solaris. From ChangeLog: * configure.ac: Add test for sys/termios.h * src/systems.h: Add macros for Solaris-style 64bit fcntl locks. * src/testgdbm.c: Add support for opening files without locking. Add sys/termios.h include and add check for TIOCWINSZ. * export/export.c: Add support for opening files without locking.
* Initial revisionJason Downs2008-11-2117-0/+1346