summaryrefslogtreecommitdiffabout
path: root/tests/gtdel.c
authorSergey Poznyakoff <gray@gnu.org>2018-07-01 07:08:55 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2018-07-01 07:19:36 (GMT)
commit030e685eb9df82f63d73a1bf206da84b7aa52374 (patch) (side-by-side diff)
treedcfc6693121e332d2cdb7c579e65ed0f397dc78e /tests/gtdel.c
parentd6fe3b45bc669a6bc3f21e4bda69c6a052d78482 (diff)
downloadgdbm-030e685eb9df82f63d73a1bf206da84b7aa52374.tar.gz
gdbm-030e685eb9df82f63d73a1bf206da84b7aa52374.tar.bz2
Change return value of gdbm_close and gdbm_sync
* src/gdbm.h.in (gdbm_close, gdbm_sync): Return int (GDBM_FILE_CLOSE_ERROR, GDBM_FILE_SYNC_ERROR): New error codes. * src/gdbmclose.c (gdbm_close): Return 0 on success, -1 on failure. Set gdbm_errno and errno. * src/gdbmsync.c (gdbm_sync): Likewise. * src/gdbmerrno.c: Handle new error codes. * src/mmap.c (_gdbm_mapped_sync): Set gdbm_errno. * src/proto.h (gdbm_file_sync): Set gdbm_errno. * doc/gdbm.3: Document changes. * doc/gdbm.texi: Document changes. * NEWS: Document changes. * configure.ac: Set patchlevel. * tests/Makefile.am: Add new test. * tests/testsuite.at: Add new test. * tests/closerr.at: New test case. * tests/closerr.c: New test program. * tests/gtdel.c: Check gdbm_close return. * tests/gtdump.c: Likewise. * tests/gtfetch.c: Likewise. * tests/gtload.c: Likewise. * tests/gtopt.c: Likewise. * tests/gtrecover.c: Likewise.
Diffstat (limited to 'tests/gtdel.c') (more/less context) (ignore whitespace changes)
-rw-r--r--tests/gtdel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/gtdel.c b/tests/gtdel.c
index 729086c..d0c711d 100644
--- a/tests/gtdel.c
+++ b/tests/gtdel.c
@@ -18,6 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <errno.h>
#include "gdbm.h"
#include "progname.h"
@@ -93,6 +94,11 @@ main (int argc, char **argv)
rc = 2;
}
}
- gdbm_close (dbf);
+ if (gdbm_close (dbf))
+ {
+ fprintf (stderr, "gdbm_close: %s; %s\n", gdbm_strerror (gdbm_errno),
+ strerror (errno));
+ rc = 3;
+ }
exit (rc);
}

Return to:

Send suggestions and report system problems to the System administrator.