mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-06-01 04:46:08 +02:00
41153: finish module setup only after all error conditions have been checked
This commit is contained in:
parent
11304f7318
commit
ca0607c4c2
|
@ -1,5 +1,8 @@
|
|||
2017-05-28 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* Sebastian: 41153: Src/Modules/db_gdbm.c: finish module setup
|
||||
only after all error conditions have been checked
|
||||
|
||||
* unposted: Doc/Zsh/mod_complist.yo: clarify ZLS_COLORS pattern
|
||||
matching contexts
|
||||
|
||||
|
|
|
@ -157,10 +157,7 @@ bin_ztie(char *nam, char **args, Options ops, UNUSED(int func))
|
|||
|
||||
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 {
|
||||
if(dbf == NULL) {
|
||||
zwarnnam(nam, "error opening database file %s (%s)", resource_name, gdbm_strerror(gdbm_errno));
|
||||
return 1;
|
||||
}
|
||||
|
@ -172,6 +169,9 @@ bin_ztie(char *nam, char **args, Options ops, UNUSED(int func))
|
|||
return 1;
|
||||
}
|
||||
|
||||
addmodulefd(gdbm_fdesc(dbf), FDT_MODULE);
|
||||
append_tied_name(pmname);
|
||||
|
||||
tied_param->gsu.h = &gdbm_hash_gsu;
|
||||
|
||||
/* Allocate parameter sub-gsu, fill dbf field.
|
||||
|
|
Loading…
Reference in New Issue