]> git.saurik.com Git - apple/libc.git/commitdiff
Libc-1244.30.3.tar.gz macos-10132 macos-10133 v1244.30.3
authorApple <opensource@apple.com>
Sat, 3 Feb 2018 22:27:54 +0000 (22:27 +0000)
committerApple <opensource@apple.com>
Sat, 3 Feb 2018 22:27:54 +0000 (22:27 +0000)
darwin/compatibility_hacks.c
sys/settimeofday.c
tests/stdtime.c

index 9de6e3c6f976a13e51e87eb8b15564f0bafda8a3..b6419abcf7a811bc4d1e094acad7cec90e695d6c 100644 (file)
@@ -36,6 +36,7 @@
                 ".previous")
 
 #define ADDED_IN_10_12(sym) WEAK_SYMBOL_LD_CMD(sym, 10.11)
+#define ADDED_IN_10_13(sym) WEAK_SYMBOL_LD_CMD(sym, 10.12)
 
 ADDED_IN_10_12(getentropy);
 
@@ -51,4 +52,6 @@ ADDED_IN_10_12(mkostemps);
 
 ADDED_IN_10_12(timingsafe_bcmp);
 
+ADDED_IN_10_13(utimensat);
+
 #endif /* TARGET_OS_IPHONE */
index 3eb4766834ba457eb2b40ec35d2b0d2332630528..5dea59c21734f38b7fe8ded88e05a396a11b1b6f 100644 (file)
@@ -43,10 +43,12 @@ settimeofday(const struct timeval *tp, const struct timezone *tzp)
        int ret = __settimeofday(tp, tzp);
        if (ret == 0) notify_post(kNotifyClockSet);
 
-       char *msg = NULL;
-       asprintf(&msg, "settimeofday({%#lx,%#x}) == %d", tp->tv_sec, tp->tv_usec, ret);
-       _simple_asl_log(ASL_LEVEL_NOTICE, "com.apple.settimeofday", msg);
-       free(msg);
+       if (tp) {
+               char *msg = NULL;
+               asprintf(&msg, "settimeofday({%#lx,%#x}) == %d", tp->tv_sec, tp->tv_usec, ret);
+               _simple_asl_log(ASL_LEVEL_NOTICE, "com.apple.settimeofday", msg);
+               free(msg);
+       }
 
        return ret;
 }
index 47e987a733f77463cca8faaccc1013fd977c86a3..80f23805f322ec2b5a5818c8ccd399e26dbde4a1 100644 (file)
@@ -4,6 +4,7 @@
 #include <string.h>
 #include <locale.h>
 #include <err.h>
+#include <TargetConditionals.h>
 
 #include <darwintest.h>
 
@@ -18,6 +19,7 @@ T_DECL(strptime_PR_24428248, "strptime parse day of year %j does not work correc
        T_EXPECT_EQ(percent_j_out, standard_out, NULL);
 }
 
+#if !TARGET_OS_BRIDGE
 T_DECL(strptime_PR_5879606, "alloca(strlen(input)) in strptime(\"%Z\")")
 {
     struct tm tm;
@@ -61,6 +63,7 @@ T_DECL(strptime_PR_6882179, "date command fails with 'illegal time format'")
     T_EXPECT_EQ(tm.tm_wday, 0x2, NULL);
     T_EXPECT_EQ(tm.tm_yday, 0x83, NULL);
 }
+#endif
 
 T_DECL(strptime_lukemftp, "year parsing"){
        struct tm tm;
@@ -140,6 +143,7 @@ T_DECL(strptime_PR_10842560, "strptime() with %W and %U")
     }
 }
 
+#if !TARGET_OS_BRIDGE
 T_DECL(strptime_asctime, "strptime->asctime")
 {
     char *test[] = {
@@ -176,3 +180,4 @@ T_DECL(strptime_asctime, "strptime->asctime")
         i++;
     }
 }
+#endif