Loading...
gen/setlogin.c Libc-997.90.3 Libc-391
--- Libc/Libc-997.90.3/gen/setlogin.c
+++ Libc/Libc-391/gen/setlogin.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -55,25 +55,12 @@
 
 
 #include <unistd.h>
-#include <pthread.h>
-#include <stdlib.h>
-#include <string.h>
 
-extern int __setlogin(const char* name);
+extern int _setlogin(const char* name);
 
-extern pthread_mutex_t __logname_mutex;
-extern char *__logname;
+extern int _logname_valid;		/* shared with getlogin() */
 
 int setlogin(const char* name)
 {
-	pthread_mutex_lock(&__logname_mutex);
-
-	int res = __setlogin(name);
-	if (res == 0 && __logname != NULL) {
-		__logname[0] = 0;
-	}
-
-	pthread_mutex_unlock(&__logname_mutex);
-
-	return res;
+	return (_logname_valid = _setlogin(name));
 }