mirror of https://github.com/BOINC/boinc.git
API: MinGWs runtime API has neither localtime_r nor localtime_s,
but it should be safe to use localtime here svn path=/trunk/boinc/; revision=22825
This commit is contained in:
parent
873c5b16a0
commit
56eb3cdf7f
|
@ -196,6 +196,7 @@ static int start_worker_signals();
|
||||||
char* boinc_msg_prefix(char* sbuf, int len) {
|
char* boinc_msg_prefix(char* sbuf, int len) {
|
||||||
char buf[256];
|
char buf[256];
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
|
struct tm *tmp = &tm;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
time_t x = time(0);
|
time_t x = time(0);
|
||||||
|
@ -204,14 +205,18 @@ char* boinc_msg_prefix(char* sbuf, int len) {
|
||||||
return sbuf;
|
return sbuf;
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
if ((tmp = localtime(&x)) == NULL) {
|
||||||
|
#else
|
||||||
if (localtime_s(&tm, &x) == EINVAL) {
|
if (localtime_s(&tm, &x) == EINVAL) {
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
if (localtime_r(&x, &tm) == NULL) {
|
if (localtime_r(&x, &tm) == NULL) {
|
||||||
#endif
|
#endif
|
||||||
strcpy(sbuf, "localtime() failed");
|
strcpy(sbuf, "localtime() failed");
|
||||||
return sbuf;
|
return sbuf;
|
||||||
}
|
}
|
||||||
if (strftime(buf, sizeof(buf)-1, "%H:%M:%S", &tm) == 0) {
|
if (strftime(buf, sizeof(buf)-1, "%H:%M:%S", tmp) == 0) {
|
||||||
strcpy(sbuf, "strftime() failed");
|
strcpy(sbuf, "strftime() failed");
|
||||||
return sbuf;
|
return sbuf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8631,3 +8631,10 @@ Charlie 6 Dec 2010
|
||||||
mac_installer/
|
mac_installer/
|
||||||
postinstall
|
postinstall
|
||||||
postupgrade
|
postupgrade
|
||||||
|
|
||||||
|
Bernd 7 Dec 2010
|
||||||
|
- API: MinGWs runtime API has neither localtime_r nor localtime_s,
|
||||||
|
but it should be safe to use localtime here
|
||||||
|
|
||||||
|
api/
|
||||||
|
boinc_api.cpp
|
||||||
|
|
Loading…
Reference in New Issue