use mkostemp(template, 0) instead of mkstemp to work around Cygwin oddity

2010-07-16  Paolo Bonzini  <bonzini@gnu.org>

	* autoboot.conf (gnulib_modules): Replace mkstemp with mkostemp.
	* bootstrap.sh.in: Compile mkostemp.c instead of mkstemp.c.
        * gnulib: Update.
        * NEWS: Mention change.
	* sed/utils.c (ck_mkstemp): Use mkostemp to work around Cygwin
	oddity.  Reported by Stepan Kasal.
This commit is contained in:
Paolo Bonzini committed 2010-07-16 22:01:35 +02:00
1 parent 9c560534c8
commit a85e83d0db
9 files changed
+57 -6

No files matched your search

+9
View File
@@ -1,3 +1,12 @@
2010-07-16 Paolo Bonzini <bonzini@gnu.org>
* autoboot.conf (gnulib_modules): Replace mkstemp with mkostemp.
* bootstrap.sh.in: Compile mkostemp.c instead of mkstemp.c.
* gnulib: Update.
* NEWS: Mention change.
* sed/utils.c (ck_mkstemp): Use mkostemp to work around Cygwin
oddity. Reported by Stepan Kasal.
2010-05-03 Timothy Baker <timothypaulbaker@gmail.com> (tiny change)
* doc/sed.texi (Regular expressions): Fix typo.
+2
View File
@@ -6,6 +6,8 @@ Sed 4.2.2
* New command `F' to print current input file name
* -i does not convert the input file to binary (LF-terminated) on Cygwin
----------------------------------------------------------------------------
Sed 4.2.1
+1 -1
View File
@@ -19,7 +19,7 @@
# gnulib modules used by this package.
gnulib_modules="
acl alloca btowc c-ctype extensions getline getopt gettext localcharset
mbrlen mbrtowc mbsinit memchr mkstemp obstack pathmax regex rename
mbrlen mbrtowc mbsinit memchr mkostemp obstack pathmax regex rename
selinux-h stdbool stat-macros ssize_t strerror strverscmp unlocked-io
verify wcrtomb wctob"
+1 -1
View File
@@ -123,7 +123,7 @@ ${CC} -DHAVE_CONFIG_H -I.. -I. -c getline.c || exit 1
${CC} -DHAVE_CONFIG_H -I.. -I. -c getopt.c || exit 1
${CC} -DHAVE_CONFIG_H -I.. -I. -c getopt1.c || exit 1
${CC} -DHAVE_CONFIG_H -I.. -I. -c malloc.c || exit 1
${CC} -DHAVE_CONFIG_H -I.. -I. -c mkstemp.c || exit 1
${CC} -DHAVE_CONFIG_H -I.. -I. -c mkostemp.c || exit 1
${CC} -DHAVE_CONFIG_H -I.. -I. -c obstack.c || exit 1
${CC} -DHAVE_CONFIG_H -I.. -I. -c quote.c || exit 1
${CC} -DHAVE_CONFIG_H -I.. -I. -c quotearg.c || exit 1
+4
View File
@@ -1,4 +1,8 @@
arg-nonnull.h
c++defs.h
config.rpath
install-sh
link-warning.h
texinfo.tex
unused-parameter.h
warn-on-use.h
+1 -1
Submodule gnulib updated: b653eda3ac...afc6cbe4fe.
+19 -1
View File
@@ -4,12 +4,15 @@ acl_entries.c
alloca.c
alloca.h
alloca.in.h
basename-lgpl.c
basename.c
btowc.c
c-ctype.c
c-ctype.h
canonicalize-lgpl.c
config.charset
copy-acl.c
dirname-lgpl.c
dirname.c
dirname.h
errno.h
@@ -20,6 +23,7 @@ exitfail.c
exitfail.h
file-has-acl.c
getdelim.c
getfilecon.c
getline.c
getopt.c
getopt.h
@@ -31,10 +35,15 @@ gettext.h
gettimeofday.c
gnulib.mk
intprops.h
langinfo.h
langinfo.in.h
localcharset.c
localcharset.h
lstat.c
malloc.c
malloca.c
malloca.h
malloca.valgrind
mbrlen.c
mbrtowc.c
mbsinit.c
@@ -42,7 +51,8 @@ memchr.c
memchr.valgrind
memcmp.c
memmove.c
mkstemp.c
mkostemp.c
nl_langinfo.c
obstack.c
obstack.h
pathmax.h
@@ -50,6 +60,7 @@ quote.c
quote.h
quotearg.c
quotearg.h
readlink.c
realloc.c
ref-add.sed
ref-add.sin
@@ -62,14 +73,19 @@ regex_internal.c
regex_internal.h
regexec.c
rename.c
rmdir.c
same-inode.h
se-context.h
se-context.in.h
se-selinux.h
se-selinux.in.h
set-mode-acl.c
stat-macros.h
stat.c
stdbool.h
stdbool.in.h
stddef.h
stddef.in.h
stdint.h
stdint.in.h
stdio-write.c
@@ -92,6 +108,8 @@ sys_time.h
sys_time.in.h
tempname.c
tempname.h
time.h
time.in.h
unistd.h
unistd.in.h
unlocked-io.h
+16
View File
@@ -2,15 +2,19 @@
00gnulib.m4
acl.m4
alloca.m4
asm-underscore.m4
btowc.m4
canonicalize.m4
codeset.m4
dirname.m4
dos.m4
double-slash-root.m4
eealloc.m4
errno_h.m4
error.m4
exitfail.m4
extensions.m4
fcntl-o.m4
getdelim.m4
getline.m4
getopt.m4
@@ -34,6 +38,7 @@ intmax.m4
inttypes-h.m4
inttypes-pri.m4
inttypes_h.m4
langinfo_h.m4
lcmessage.m4
lib-ld.m4
lib-link.m4
@@ -47,6 +52,7 @@ longdouble.m4
longlong.m4
lstat.m4
malloc.m4
malloca.m4
mbrlen.m4
mbrtowc.m4
mbsinit.m4
@@ -54,9 +60,11 @@ mbstate_t.m4
memchr.m4
memcmp.m4
memmove.m4
mkostemp.m4
mkstemp.m4
mmap-anon.m4
multiarch.m4
nl_langinfo.m4
nls.m4
pathmax.m4
po.m4
@@ -64,15 +72,19 @@ printf-posix.m4
progtest.m4
quote.m4
quotearg.m4
readlink.m4
realloc.m4
regex.m4
rename.m4
rmdir.m4
selinux-context-h.m4
selinux-selinux-h.m4
signed.m4
size_max.m4
ssize_t.m4
stat.m4
stdbool.m4
stddef_h.m4
stdint.m4
stdint_h.m4
stdio_h.m4
@@ -86,16 +98,20 @@ sys_stat_h.m4
sys_time_h.m4
tempname.m4
threadlib.m4
time_h.m4
uintmax_t.m4
ulonglong.m4
unistd_h.m4
unlocked-io.m4
visibility.m4
warn-on-use.m4
wchar.m4
wchar_h.m4
wchar_t.m4
wcrtomb.m4
wctob.m4
wctype.m4
wctype_h.m4
wint_t.m4
xalloc.m4
xsize.m4
+4 -2
View File
@@ -211,9 +211,11 @@ ck_mkstemp (p_filename, tmpdir, base)
sprintf (template, "%s/%sXXXXXX", tmpdir, base);
/* The ownership might change, so omit some permissions at first
so unauthorized users cannot nip in before the file is ready. */
so unauthorized users cannot nip in before the file is ready.
mkstemp forces O_BINARY on cygwin, so use mkostemp instead. */
save_umask = umask (0700);
fd = mkstemp (template);
fd = mkostemp (template, 0);
umask (save_umask);
if (fd == -1)
panic(_("couldn't open temporary file %s: %s"), template, strerror(errno));