Loading...
sys/settimeofday.c Libc-1725.40.4 Libc-1244.1.7
--- Libc/Libc-1725.40.4/sys/settimeofday.c
+++ Libc/Libc-1244.1.7/sys/settimeofday.c
@@ -21,15 +21,9 @@
  * @APPLE_LICENSE_HEADER_END@
  */
 
-#include <TargetConditionals.h>
-#if !TARGET_OS_DRIVERKIT
+#include <sys/time.h>
 #include <notify.h>
 #include <notify_keys.h>
-#else
-#define notify_post(...)
-#endif
-#include <errno.h>
-#include <sys/time.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include "_simple.h"
@@ -47,20 +41,12 @@
 settimeofday(const struct timeval *tp, const struct timezone *tzp)
 {
 	int ret = __settimeofday(tp, tzp);
-	int serror = 0;
-	if (ret == 0) {
-		notify_post(kNotifyClockSet);
-	} else {
-		serror = errno;
-	}
+	if (ret == 0) notify_post(kNotifyClockSet);
 
-	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);
-	}
+	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);
 
-	errno = serror;
 	return ret;
 }