]> git.saurik.com Git - apple/libc.git/blob - gen/FreeBSD/getlogin.c.patch
Libc-498.1.5.tar.gz
[apple/libc.git] / gen / FreeBSD / getlogin.c.patch
1 --- getlogin.c.orig 2007-08-19 17:24:10.000000000 -0700
2 +++ getlogin.c 2007-08-19 20:51:27.000000000 -0700
3 @@ -40,7 +40,6 @@
4 #include <sys/param.h>
5 #include <errno.h>
6 #include <pwd.h>
7 -#include <utmp.h>
8 #include <stdio.h>
9 #include <string.h>
10 #include <unistd.h>
11 @@ -53,7 +52,7 @@
12 #define THREAD_LOCK() if (__isthreaded) _pthread_mutex_lock(&logname_mutex)
13 #define THREAD_UNLOCK() if (__isthreaded) _pthread_mutex_unlock(&logname_mutex)
14
15 -extern int _getlogin(char *, int);
16 +extern int __getlogin(char *, int);
17
18 int _logname_valid; /* known to setlogin() */
19 static pthread_mutex_t logname_mutex = PTHREAD_MUTEX_INITIALIZER;
20 @@ -64,7 +63,7 @@
21 static char logname[MAXLOGNAME];
22
23 if (_logname_valid == 0) {
24 - if (_getlogin(logname, sizeof(logname)) < 0) {
25 + if (__getlogin(logname, sizeof(logname)) < 0) {
26 *status = errno;
27 return (NULL);
28 }
29 @@ -87,7 +86,7 @@
30 }
31
32 int
33 -getlogin_r(char *logname, int namelen)
34 +getlogin_r(char *logname, size_t namelen)
35 {
36 char *result;
37 int len;