Deleted Added
full compact
getlogin.c (90039) getlogin.c (93399)
1/*
2 * Copyright (c) 1988, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 21 unchanged lines hidden (view full) ---

30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#if defined(LIBC_SCCS) && !defined(lint)
35static char sccsid[] = "@(#)getlogin.c 8.1 (Berkeley) 6/4/93";
36#endif /* LIBC_SCCS and not lint */
37#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1988, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 21 unchanged lines hidden (view full) ---

30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#if defined(LIBC_SCCS) && !defined(lint)
35static char sccsid[] = "@(#)getlogin.c 8.1 (Berkeley) 6/4/93";
36#endif /* LIBC_SCCS and not lint */
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/lib/libc/gen/getlogin.c 90039 2002-02-01 00:57:29Z obrien $");
38__FBSDID("$FreeBSD: head/lib/libc/gen/getlogin.c 93399 2002-03-29 22:43:43Z markm $");
39
40#include <sys/param.h>
41#include <errno.h>
42#include <pwd.h>
43#include <utmp.h>
44#include <stdio.h>
45#include <string.h>
46#include <unistd.h>
47#include "namespace.h"
48#include <pthread.h>
49#include "un-namespace.h"
50
39
40#include <sys/param.h>
41#include <errno.h>
42#include <pwd.h>
43#include <utmp.h>
44#include <stdio.h>
45#include <string.h>
46#include <unistd.h>
47#include "namespace.h"
48#include <pthread.h>
49#include "un-namespace.h"
50
51#include <libc_private.h>
51#include "libc_private.h"
52
53#define THREAD_LOCK() if (__isthreaded) _pthread_mutex_lock(&logname_mutex)
54#define THREAD_UNLOCK() if (__isthreaded) _pthread_mutex_unlock(&logname_mutex)
55
56extern int _getlogin(char *, int);
57
58int _logname_valid; /* known to setlogin() */
59static pthread_mutex_t logname_mutex = PTHREAD_MUTEX_INITIALIZER;

--- 51 unchanged lines hidden ---
52
53#define THREAD_LOCK() if (__isthreaded) _pthread_mutex_lock(&logname_mutex)
54#define THREAD_UNLOCK() if (__isthreaded) _pthread_mutex_unlock(&logname_mutex)
55
56extern int _getlogin(char *, int);
57
58int _logname_valid; /* known to setlogin() */
59static pthread_mutex_t logname_mutex = PTHREAD_MUTEX_INITIALIZER;

--- 51 unchanged lines hidden ---