mirror of https://github.com/aria2/aria2
2007-08-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Merged Ross's patch: Removed setmode(). Use _CRT_fmode to enable binary IO. * src/DefaultBtProgressInfoFile.cc * src/MetaFileUtil.cc * src/SimpleLogger.cc * src/SegmentMan.cc * src/Util.cc * src/Platform.ccpull/1/head
parent
674a077bff
commit
eb335ef44c
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2007-08-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
Merged Ross's patch: Removed setmode(). Use _CRT_fmode to enable binary
|
||||||
|
IO.
|
||||||
|
* src/DefaultBtProgressInfoFile.cc
|
||||||
|
* src/MetaFileUtil.cc
|
||||||
|
* src/SimpleLogger.cc
|
||||||
|
* src/SegmentMan.cc
|
||||||
|
* src/Util.cc
|
||||||
|
* src/Platform.cc
|
||||||
|
|
||||||
2007-08-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2007-08-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
* src/Xml2MetalinkProcessor.cc (getPieceHash): Added missing .c_str().
|
* src/Xml2MetalinkProcessor.cc (getPieceHash): Added missing .c_str().
|
||||||
|
|
|
@ -230,9 +230,6 @@
|
||||||
/* Define to 1 if you have the `setlocale' function. */
|
/* Define to 1 if you have the `setlocale' function. */
|
||||||
#undef HAVE_SETLOCALE
|
#undef HAVE_SETLOCALE
|
||||||
|
|
||||||
/* Define to 1 if you have the `setmode' function. */
|
|
||||||
#undef HAVE_SETMODE
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `sigaction' function. */
|
/* Define to 1 if you have the `sigaction' function. */
|
||||||
#undef HAVE_SIGACTION
|
#undef HAVE_SIGACTION
|
||||||
|
|
||||||
|
|
|
@ -12694,8 +12694,7 @@ done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for ac_func in __argz_count __argz_next __argz_stringify daemon ftruncate getcwd getpagesize inet_ntoa memchr mempcpy memset mkdir munmap nl_langinfo random rmdir select setlocale sigaction sleep socket srandom stpcpy strcasecmp strchr strcspn strdup strerror strstr strtol strtoul unsetenv usleep
|
||||||
for ac_func in __argz_count __argz_next __argz_stringify daemon ftruncate getcwd getpagesize inet_ntoa memchr mempcpy memset mkdir munmap nl_langinfo random rmdir select setlocale setmode sigaction sleep socket srandom stpcpy strcasecmp strchr strcspn strdup strerror strstr strtol strtoul unsetenv usleep
|
|
||||||
do
|
do
|
||||||
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||||
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
|
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
|
||||||
|
|
|
@ -141,7 +141,7 @@ AC_FUNC_MMAP
|
||||||
AC_FUNC_SELECT_ARGTYPES
|
AC_FUNC_SELECT_ARGTYPES
|
||||||
AC_FUNC_STAT
|
AC_FUNC_STAT
|
||||||
AC_FUNC_VPRINTF
|
AC_FUNC_VPRINTF
|
||||||
AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify daemon ftruncate getcwd getpagesize inet_ntoa memchr mempcpy memset mkdir munmap nl_langinfo random rmdir select setlocale setmode sigaction sleep socket srandom stpcpy strcasecmp strchr strcspn strdup strerror strstr strtol strtoul unsetenv usleep])
|
AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify daemon ftruncate getcwd getpagesize inet_ntoa memchr mempcpy memset mkdir munmap nl_langinfo random rmdir select setlocale sigaction sleep socket srandom stpcpy strcasecmp strchr strcspn strdup strerror strstr strtol strtoul unsetenv usleep])
|
||||||
|
|
||||||
AC_CHECK_FUNCS([basename],
|
AC_CHECK_FUNCS([basename],
|
||||||
[AM_CONDITIONAL([HAVE_BASENAME], true)],
|
[AM_CONDITIONAL([HAVE_BASENAME], true)],
|
||||||
|
|
|
@ -162,9 +162,6 @@ FILE* DefaultBtProgressInfoFile::openFile(const string& filename,
|
||||||
throw new DlAbortEx(EX_SEGMENT_FILE_OPEN,
|
throw new DlAbortEx(EX_SEGMENT_FILE_OPEN,
|
||||||
filename.c_str(), strerror(errno));
|
filename.c_str(), strerror(errno));
|
||||||
}
|
}
|
||||||
#ifdef HAVE_SETMODE
|
|
||||||
setmode(fileno(file), O_BINARY);
|
|
||||||
#endif
|
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,9 +48,6 @@ MetaEntry* MetaFileUtil::parseMetaFile(const string& file) {
|
||||||
if(fp == NULL) {
|
if(fp == NULL) {
|
||||||
throw new DlAbortEx("cannot open metainfo file");
|
throw new DlAbortEx("cannot open metainfo file");
|
||||||
}
|
}
|
||||||
#ifdef HAVE_SETMODE
|
|
||||||
setmode(fileno(fp), O_BINARY);
|
|
||||||
#endif
|
|
||||||
if(fread(buf, len, 1, fp) != 1) {
|
if(fread(buf, len, 1, fp) != 1) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
throw new DlAbortEx("cannot read metainfo");
|
throw new DlAbortEx("cannot read metainfo");
|
||||||
|
|
|
@ -50,8 +50,11 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "DlAbortEx.h"
|
#include "DlAbortEx.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
|
#include <stdlib.h> /* _fmode */
|
||||||
|
#include <fcntl.h> /* _O_BINARY */
|
||||||
|
|
||||||
Platform::Platform() {
|
Platform::Platform() {
|
||||||
|
unsigned int _CRT_fmode = _O_BINARY;
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
memset((char*)&wsaData, 0, sizeof(wsaData));
|
memset((char*)&wsaData, 0, sizeof(wsaData));
|
||||||
if (WSAStartup(MAKEWORD(1, 1), &wsaData)) {
|
if (WSAStartup(MAKEWORD(1, 1), &wsaData)) {
|
||||||
|
|
|
@ -148,9 +148,6 @@ FILE* SegmentMan::openSegFile(const string& segFilename, const string& mode) con
|
||||||
throw new DlAbortEx(EX_SEGMENT_FILE_OPEN,
|
throw new DlAbortEx(EX_SEGMENT_FILE_OPEN,
|
||||||
segFilename.c_str(), strerror(errno));
|
segFilename.c_str(), strerror(errno));
|
||||||
}
|
}
|
||||||
#ifdef HAVE_SETMODE
|
|
||||||
setmode(fileno(segFile), O_BINARY);
|
|
||||||
#endif
|
|
||||||
return segFile;
|
return segFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,9 +72,6 @@ void SimpleLogger::openFile(const string& filename) {
|
||||||
if(file == NULL) {
|
if(file == NULL) {
|
||||||
throw new DlAbortEx(EX_FILE_OPEN, filename.c_str(), strerror(errno));
|
throw new DlAbortEx(EX_FILE_OPEN, filename.c_str(), strerror(errno));
|
||||||
}
|
}
|
||||||
#ifdef HAVE_SETMODE
|
|
||||||
setmode(fileno(file), O_BINARY);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleLogger::closeFile() {
|
void SimpleLogger::closeFile() {
|
||||||
|
|
|
@ -314,9 +314,6 @@ string Util::toHex(const unsigned char* src, int32_t len) {
|
||||||
|
|
||||||
FILE* Util::openFile(const string& filename, const string& mode) {
|
FILE* Util::openFile(const string& filename, const string& mode) {
|
||||||
FILE* file = fopen(filename.c_str(), mode.c_str());
|
FILE* file = fopen(filename.c_str(), mode.c_str());
|
||||||
#ifdef HAVE_SETMODE
|
|
||||||
setmode(fileno(file), O_BINARY);
|
|
||||||
#endif
|
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue