Loading...
util/logout.c Libc-1725.40.4 Libc-498
--- Libc/Libc-1725.40.4/util/logout.c
+++ Libc/Libc-498/util/logout.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, 2010 Apple Inc. All rights reserved.
+ * Copyright (c) 1999, 2005 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -64,9 +64,6 @@
 #include <unistd.h>
 #include <string.h>
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wconstant-conversion"
-
 int
 logout(char *line)
 {
@@ -80,22 +77,17 @@
 	int which;
 #endif /* UTMP_COMPAT */
 
-	struct _utmpx *def_utx = __default_utx();
-
 	bzero(&utx, sizeof(utx));
 	strncpy(utx.ut_line, line, sizeof(utx.ut_line));
 	utx.ut_type = UTMPX_AUTOFILL_MASK | UTMPX_DEAD_IF_CORRESPONDING_MASK | DEAD_PROCESS;
 	(void)gettimeofday(&utx.ut_tv, NULL);
-	UTMPX_LOCK(def_utx);
-	__setutxent(def_utx);
-	ux = __pututxline(def_utx, &utx);
-	__endutxent(def_utx);
-	if (!ux) {
-		UTMPX_UNLOCK(def_utx);
+	setutxent();
+	ux = _pututxline(&utx);
+	endutxent();
+	if (!ux)
 		return 0;
-	}
 #ifdef UTMP_COMPAT
-	if (__utx__.utfile_system) { /* only if we are using _PATH_UTMPX */
+	if (utfile_system) { /* only if we are using _PATH_UTMPX */
 		which = _utmp_compat(ux, &u);
 		if (which & UTMP_COMPAT_UTMP0)
 			_write_utmp(&u, 0);
@@ -103,7 +95,5 @@
 			_write_utmp(&u, 1);
 	}
 #endif /* UTMP_COMPAT */
-	UTMPX_UNLOCK(def_utx);
 	return 1;
 }
-#pragma clang diagnostic pop