minors
authoradam <anton@adamansky.com>
Tue, 16 Apr 2013 10:56:06 +0000 (17:56 +0700)
committeradam <anton@adamansky.com>
Tue, 16 Apr 2013 10:56:06 +0000 (17:56 +0700)
tcejdb/Makefile.in
tcejdb/win32/platform.c

index 191c52f..60cbe64 100644 (file)
@@ -844,6 +844,6 @@ tokyocabinet_all.c : myconf.c tcutil.c md5.c tchdb.c tcbdb.c tcfdb.c tctdb.c tca
 
 tokyocabinet_all.o : myconf.h tcutil.h tchdb.h tcbdb.h tcfdb.h tctdb.h tcadb.h
 
-platform.o : basedefs.h platform.c
+platform.o : basedefs.h platform.c win32/platform.c
 
 # END OF FILE
index d19e6c1..62a62f5 100644 (file)
@@ -7,8 +7,8 @@ struct tm *gmtime_r(const time_t *timep, struct tm *result) {
     pthread_mutex_lock(&mutex);
     struct tm *cas = gmtime(timep);
     pthread_mutex_unlock(&mutex);
-    if (result == NULL) {
-        return NULL; /* was:cas */
+    if (result == NULL || cas == NULL) {
+        return NULL;
     }
     memcpy(result, cas, sizeof (struct tm));
     return result;
@@ -19,7 +19,7 @@ struct tm *localtime_r(const time_t *timep, struct tm *result) {
     pthread_mutex_lock(&mutex);
     struct tm *cas = localtime(timep);
     pthread_mutex_unlock(&mutex);
-    if (result == NULL) {
+    if (result == NULL || cas == NULL) {
         return NULL;
     }
     memcpy(result, cas, sizeof (struct tm));