1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-17 11:41:07 +01:00

40898: fix GDBM error handling

This commit is contained in:
Sebastian Gniazdowski 2017-03-25 07:55:54 +01:00 committed by Peter Stephenson
parent 99fff8f15c
commit 135075e48c
2 changed files with 6 additions and 1 deletions

View file

@ -154,12 +154,13 @@ bin_ztie(char *nam, char **args, Options ops, UNUSED(int func))
return 1;
}
gdbm_errno=0;
dbf = gdbm_open(resource_name, 0, read_write, 0666, 0);
if(dbf) {
addmodulefd(gdbm_fdesc(dbf), FDT_MODULE);
append_tied_name(pmname);
} else {
zwarnnam(nam, "error opening database file %s", resource_name);
zwarnnam(nam, "error opening database file %s (%s)", resource_name, gdbm_strerror(gdbm_errno));
return 1;
}