From: Wayne Davison <wayned@users.sourceforge.net>
To: zsh-workers@sunsite.dk
Subject: Improved HISTFILE locking
Date: Mon, 18 Oct 2004 12:36:25 -0700 [thread overview]
Message-ID: <20041018193625.GF10807@blorf.net> (raw)
In-Reply-To: <20041018050032.GA32556@blorf.net>
On Sun, Oct 17, 2004 at 10:00:32PM -0700, Wayne Davison wrote:
> Looks like a simple improvement to gettempname() to make it take an
> optional prefix arg will allow us to use that to create a better
> unique filename based on $HISTFILE. I've attached a patch that
> implements this, fixes an unsafe use of gettempname() in builtin.c,
> and adds a new string function named bicat() that works like dyncat(),
> but uses permanent memory instead of the heap.
I improved a few things in that patch and checked it in. The
improvements were:
- In my safety fix in builtin.c, made sure that errno doesn't get
changed by fdopen() if the open() call failed.
- In lockhistfile() in hist.c, delayed the fdopen() so that it doesn't
interfere with the locking logic.
- In gettempname(), made the logic for adding a separating '.' between
the prefix and the suffix depend on the presence of a non-NULL
prefix, not on the setting of the use_heap variable. (The end result
is the same, but the function's behavior is more logical.)
..wayne..
prev parent reply other threads:[~2004-10-18 19:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-01 19:36 skip rewriting history if exiting due to signal Wayne Davison
2004-10-17 19:48 ` Wayne Davison
2004-10-18 0:21 ` Bart Schaefer
2004-10-18 5:00 ` Wayne Davison
2004-10-18 19:36 ` Wayne Davison [this message]
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=20041018193625.GF10807@blorf.net \
--to=wayned@users.sourceforge.net \
--cc=zsh-workers@sunsite.dk \
/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).