mirror of
https://github.com/mirror/wget.git
synced 2025-02-04 08:40:18 +08:00
Removing "Could not open temporary WARC manifest file." issue in Win builds
This commit is contained in:
parent
099d8ee3da
commit
5ce9389384
@ -1,3 +1,7 @@
|
||||
2013-05-17 Bykov Aleksey <gnfalex@rambler.ru>
|
||||
|
||||
* bootstrap: Add `mkostemp'
|
||||
|
||||
2012-10-07 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||
|
||||
* configure.ac: Check for patchconf.
|
||||
|
@ -52,6 +52,7 @@ maintainer-makefile
|
||||
mbtowc
|
||||
mkdir
|
||||
mkstemp
|
||||
mkostemp
|
||||
crypto/md5
|
||||
crypto/sha1
|
||||
pipe
|
||||
|
@ -1,3 +1,9 @@
|
||||
2013-05-14 Bykov Aleksey <gnfalex@rambler.ru>
|
||||
|
||||
* warc.c (warc_tempfile): For fix "Could not open temporary WARC manifest
|
||||
file." issue in Win system force to use `mkostemp(filename, O_TEMPORARY)'
|
||||
instead of `mkstemp(filename)'. Thank to Angel Gonzalez for help.
|
||||
|
||||
2013-05-14 Tim Ruehsen <tim.ruehsen@gmx.de>
|
||||
|
||||
* cookies.c (cookie_jar_load): Replaced read_whole_file() by getline().
|
||||
|
11
src/warc.c
11
src/warc.c
@ -51,10 +51,16 @@ as that of the covered work. */
|
||||
|
||||
#ifndef WINDOWS
|
||||
#include <libgen.h>
|
||||
#else
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include "warc.h"
|
||||
|
||||
#ifndef O_TEMPORARY
|
||||
#define O_TEMPORARY 0
|
||||
#endif
|
||||
|
||||
extern char *version_string;
|
||||
|
||||
/* Set by main in main.c */
|
||||
@ -1147,12 +1153,15 @@ warc_tempfile (void)
|
||||
if (path_search (filename, 100, opt.warc_tempdir, "wget", true) == -1)
|
||||
return NULL;
|
||||
|
||||
int fd = mkstemp (filename);
|
||||
int fd = mkostemp (filename, O_TEMPORARY);
|
||||
if (fd < 0)
|
||||
return NULL;
|
||||
|
||||
#if !O_TEMPORARY
|
||||
if (unlink (filename) < 0)
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
|
||||
return fdopen (fd, "wb+");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user