summaryrefslogtreecommitdiffabout
path: root/tests/gtload.c
Side-by-side diff
Diffstat (limited to 'tests/gtload.c') (more/less context) (ignore whitespace changes)
-rw-r--r--tests/gtload.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/tests/gtload.c b/tests/gtload.c
index f75f671..550833f 100644
--- a/tests/gtload.c
+++ b/tests/gtload.c
@@ -19,21 +19,7 @@
#include <stdlib.h>
#include <string.h>
#include "gdbm.h"
-
-const char *
-canonical_progname (const char *str)
-{
- const char *p;
-
- p = strrchr (str, '/');
- if (p)
- p++;
- else
- p = str;
- if (strncmp (p, "lt-", 3) == 0)
- p += 3;
- return p;
-}
+#include "progname.h"
int
main (int argc, char **argv)
@@ -100,6 +86,11 @@ main (int argc, char **argv)
dbname = *argv;
dbf = gdbm_open (dbname, block_size, mode|flags, 00664, NULL);
+ if (!dbf)
+ {
+ fprintf (stderr, "gdbm_open failed: %s\n", gdbm_strerror (gdbm_errno));
+ exit (1);
+ }
while (fgets (buf, sizeof buf, stdin))
{

Return to:

Send suggestions and report system problems to the System administrator.