[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mkstemp
From: |
Bruno Haible |
Subject: |
Re: mkstemp |
Date: |
Wed, 27 Apr 2011 23:29:16 +0200 |
User-agent: |
KMail/1.9.9 |
Eric Blake wrote:
> I also think doc/posix-functions/mkstemp.texi could
> use a similar comment. I added that, and pushed the modified result.
Thanks, but...
"The gnulib module clean-temp can create temporary files that are less
likely to be left behind on signals such as SIGINT."
Just "less likely"?! The code in module 'clean-temp' goes through all kinds of
hoops with signal handlers and 'volatile' variables to make _sure_ that the
temporary files are cleaned up. This has also been tested as part of the
'msgfmt' program.
It may not have been clear because of lack of comments. So let me add such
comments.
2011-04-27 Bruno Haible <address@hidden>
clean-temp: Clarify what it does.
* lib/clean-temp.h: Add more comments.
* doc/posix-functions/mkstemp.texi: Tweak reference to 'clean-temp'
module.
* doc/glibc-functions/mkostemp.texi: Mention 'clean-temp' here too.
* doc/glibc-functions/mkstemps.texi: Likewise.
* doc/glibc-functions/mkostemps.texi: Likewise.
--- lib/clean-temp.h.orig Wed Apr 27 23:19:52 2011
+++ lib/clean-temp.h Wed Apr 27 23:19:47 2011
@@ -1,5 +1,5 @@
/* Temporary directories and temporary files with automatic cleanup.
- Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2011 Free Software Foundation, Inc.
Written by Bruno Haible <address@hidden>, 2006.
This program is free software: you can redistribute it and/or modify
@@ -39,7 +39,11 @@
This module provides support for temporary directories and temporary files
inside these temporary directories. Temporary files without temporary
- directories are not supported here. */
+ directories are not supported here. The temporary directories and files
+ are automatically cleaned up (at the latest) when the program exits or
+ dies from a fatal signal such as SIGINT, SIGTERM, SIGHUP, but not if it
+ dies from a fatal signal such as SIGQUIT, SIGKILL, or SIGABRT, SIGSEGV,
+ SIGBUS, SIGILL, SIGFPE, */
struct temp_dir
{
--- doc/posix-functions/mkstemp.texi.orig Wed Apr 27 23:19:52 2011
+++ doc/posix-functions/mkstemp.texi Wed Apr 27 23:18:04 2011
@@ -25,5 +25,5 @@
@itemize
@end itemize
-The gnulib module clean-temp can create temporary files that are less
-likely to be left behind on signals such as SIGINT.
+The gnulib module @code{clean-temp} can create temporary files that will not
+be left behind after signals such as SIGINT.
--- doc/glibc-functions/mkostemp.texi.orig Wed Apr 27 23:19:52 2011
+++ doc/glibc-functions/mkostemp.texi Wed Apr 27 23:18:43 2011
@@ -15,3 +15,6 @@
Portability problems not fixed by Gnulib:
@itemize
@end itemize
+
+The gnulib module @code{clean-temp} can create temporary files that will not
+be left behind after signals such as SIGINT.
--- doc/glibc-functions/mkostemps.texi.orig Wed Apr 27 23:19:52 2011
+++ doc/glibc-functions/mkostemps.texi Wed Apr 27 23:18:43 2011
@@ -15,3 +15,6 @@
Portability problems not fixed by Gnulib:
@itemize
@end itemize
+
+The gnulib module @code{clean-temp} can create temporary files that will not
+be left behind after signals such as SIGINT.
--- doc/glibc-functions/mkstemps.texi.orig Wed Apr 27 23:19:52 2011
+++ doc/glibc-functions/mkstemps.texi Wed Apr 27 23:18:11 2011
@@ -15,3 +15,6 @@
Portability problems not fixed by Gnulib:
@itemize
@end itemize
+
+The gnulib module @code{clean-temp} can create temporary files that will not
+be left behind after signals such as SIGINT.
--
In memoriam Marian Batko <http://pl.wikipedia.org/wiki/Marian_Batko>
<http://en.auschwitz.org.pl/m/index.php?Itemid=8&id=478&option=com_content&task=view>
- mkstemp, Reuben Thomas, 2011/04/26
- Re: mkstemp, Bruno Haible, 2011/04/26
- Re: mkstemp, Reuben Thomas, 2011/04/27
- Re: mkstemp, Eric Blake, 2011/04/27
- Re: mkstemp, Reuben Thomas, 2011/04/27
- Re: mkstemp, Eric Blake, 2011/04/27
- Re: mkstemp, Reuben Thomas, 2011/04/27
- Re: mkstemp,
Bruno Haible <=
- Re: mkstemp, Eric Blake, 2011/04/27
- Re: mkstemp, Bruno Haible, 2011/04/27
- Re: mkstemp, Reuben Thomas, 2011/04/27
- Re: mkstemp, Eric Blake, 2011/04/27
- [PATCH] mkstemp: replace if system version uses wrong permissions, Eric Blake, 2011/04/27
- Re: [PATCH] mkstemp: replace if system version uses wrong permissions, Reuben Thomas, 2011/04/27
- Re: [PATCH] mkstemp: replace if system version uses wrong permissions, Eric Blake, 2011/04/27
- Re: [PATCH] mkstemp: replace if system version uses wrong permissions, Bruno Haible, 2011/04/27
- Re: mkstemp, Bruno Haible, 2011/04/27
- Re: mkstemp, Eric Blake, 2011/04/27