Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Use gdbm_errno with gdbm_open
- X-seq: zsh-workers 40899
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Use gdbm_errno with gdbm_open
- Date: Sat, 25 Mar 2017 10:12:25 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=y+7+5RkjmtviekFzzLLgwmr6V08qFjeCGC5KxSS7Ko0=; b=dQnPMhDv 6I5UU7VWgL0Z3TX7tmsuW5M7HMufrGL/AJOoseW03a5zEkn2iE4KdJRq6WSTQCTX 2JurXxr+pP86vNbRECfUrZ+fACXD/pl+1p9QdGBwKpiEw3LFWs3fSRdAamv2U4Au vXc5SHVbKLocNBcETUu4f+u2PR1KqgHpN/GRXtZ/y26U4hWjxKRGQyK3ueiQ6vnw VKIiriZm9n3+QI75kAnL72BRpGEY+qUg0gmjaSbFd0G3zkAzTTORs2wl+laEVLFk 285lKess4VudzBpP3pVjgtlGXi1rDY00DfRWMvG9b+j27NnbrjTVUD8XYnaPvWb8 ANbiV4sYca2ZHA==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=y+7+5RkjmtviekFzzLLgwmr6V08qFjeCGC5KxSS7Ko0=; b=LTwJNDOj aNKW9LIn3SFrnQuqddE67M9uzpE5HLLjI5VDLgRQd6sgtZUVbOfc+b7+VPcaEUxk +nT9/ZIU7sYt49m+WtcMlcApsHBU+v2snog2noyS0+praXdTaaq0D7fC4C8VJ+Ax j0kJ1vYXpIT4CCqGaiHnHPPAhhzrGkdCgZeo21oLlL0p6Fj0DoiljmMRE0FhcvsJ ffchpRp5gDCPudtlKgXX8glvFaoGDsSLLOpPt7T/uWI2YF8H67MKEN0Jt9lmmKJH wVo1QzvyWRuoNSCt0Kx2y6tMVzwal0mqzpz4gi7LuTDjOG6PGAhaAGXz0ODj3RXM 65MZwYEcZuKE2w==
- In-reply-to: <etPan.58d6147a.643c9869.17199@MacMini.local>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <etPan.58d6147a.643c9869.17199@MacMini.local>
Sebastian Gniazdowski wrote on Sat, Mar 25, 2017 at 07:55:54 +0100:
> +++ b/Src/Modules/db_gdbm.c
> @@ -154,12 +154,13 @@ bin_ztie(char *nam, char **args, Options ops, UNUSED(int func))
> + gdbm_errno=0;
Nitpick: whitespace around assignment operator.
> 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));
How about
"error opening database file '%s'; gdbm error: %s"
?
That is: add quotes, avoid parentheses around pertinent information, and
sign gdbm's error message. (I'd have used %q as in printf(1), but
I don't think zerrmsg() supports that yet.)
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author