From: Apple Date: Sat, 3 Feb 2018 22:27:54 +0000 (+0000) Subject: Libc-1244.30.3.tar.gz X-Git-Tag: macos-10132^0 X-Git-Url: https://git.saurik.com/apple/libc.git/commitdiff_plain/c92a3ae8556c6113025cea583e06396c2824ed41 Libc-1244.30.3.tar.gz --- diff --git a/darwin/compatibility_hacks.c b/darwin/compatibility_hacks.c index 9de6e3c..b6419ab 100644 --- a/darwin/compatibility_hacks.c +++ b/darwin/compatibility_hacks.c @@ -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 */ diff --git a/sys/settimeofday.c b/sys/settimeofday.c index 3eb4766..5dea59c 100644 --- a/sys/settimeofday.c +++ b/sys/settimeofday.c @@ -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; } diff --git a/tests/stdtime.c b/tests/stdtime.c index 47e987a..80f2380 100644 --- a/tests/stdtime.c +++ b/tests/stdtime.c @@ -4,6 +4,7 @@ #include #include #include +#include #include @@ -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