zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] Use gdbm_errno with gdbm_open
Date: Sat, 25 Mar 2017 10:12:25 +0000	[thread overview]
Message-ID: <20170325101225.GA3785@fujitsu.shahaf.local2> (raw)
In-Reply-To: <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


  reply	other threads:[~2017-03-25 10:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-25  6:55 Sebastian Gniazdowski
2017-03-25 10:12 ` Daniel Shahaf [this message]
2017-03-25 13:52   ` Sebastian Gniazdowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170325101225.GA3785@fujitsu.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).