unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Angelo Graziosi <angelo.graziosi@alice.it>
Cc: Emacs <emacs-devel@gnu.org>
Subject: Re: Warning on 'mktemp' [Cygwin]
Date: Sun, 23 May 2010 14:25:49 +0200	[thread overview]
Message-ID: <874ohyls8i.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <4BF91881.5020902@alice.it> (Angelo Graziosi's message of "Sun, 23 May 2010 13:58:57 +0200")

* Angelo Graziosi:

> Note that 'configure' says: "checking for mkstemp... yes", so I have
> applied this patch:
>
> ================
> $ cat movemail.c.patch
> --- movemail.c.orig     2010-04-02 23:54:26.000000000 +0200
> +++ movemail.c  2010-05-23 12:35:06.296875000 +0200
> @@ -302,7 +302,7 @@
>         p--;
>        *p = 0;
>        strcpy (p, "EXXXXXX");
> -      mktemp (tempname);
> +      mkstemp (tempname);
>        unlink (tempname);
>
>        while (1)
> ================
>
> and the warning disappeared. But is it safe apply it, at least locally
> on Cygwin?

mkstemp returns a file descriptor which you have to close.  And you
must not unlink the file, otherwise the behavior is as bad as
mktemp() because the race is still there.



      reply	other threads:[~2010-05-23 12:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-23 11:58 Warning on 'mktemp' [Cygwin] Angelo Graziosi
2010-05-23 12:25 ` Florian Weimer [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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=874ohyls8i.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=angelo.graziosi@alice.it \
    --cc=emacs-devel@gnu.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.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).