Make it compile with uClibc
This commit is contained in:
parent
75220b55ff
commit
a07c902648
10
getty.c
10
getty.c
@ -517,11 +517,13 @@ void update_utmp(line)
|
|||||||
char *line;
|
char *line;
|
||||||
{
|
{
|
||||||
struct utmp ut;
|
struct utmp ut;
|
||||||
time_t t;
|
|
||||||
int mypid = getpid();
|
int mypid = getpid();
|
||||||
long time();
|
long time();
|
||||||
long lseek();
|
long lseek();
|
||||||
|
#ifndef __UCLIBC__
|
||||||
|
time_t t;
|
||||||
struct utmp *utp;
|
struct utmp *utp;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ! (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))
|
#if ! (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))
|
||||||
struct flock lock;
|
struct flock lock;
|
||||||
@ -536,7 +538,7 @@ char *line;
|
|||||||
* entry in the utmp file.
|
* entry in the utmp file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifndef __UCLIBC__
|
||||||
utmpname(_PATH_UTMP);
|
utmpname(_PATH_UTMP);
|
||||||
setutent();
|
setutent();
|
||||||
while ((utp = getutent())
|
while ((utp = getutent())
|
||||||
@ -571,8 +573,8 @@ char *line;
|
|||||||
{
|
{
|
||||||
int ut_fd;
|
int ut_fd;
|
||||||
|
|
||||||
if ((ut_fd = open(UTMP_FILE, 2)) < 0) {
|
if ((ut_fd = open(_PATH_WTMP, 2)) < 0) {
|
||||||
error("%s: open for update: %m"), UTMP_FILE;
|
error("%s: open for update: %m"), _PATH_WTMP;
|
||||||
} else {
|
} else {
|
||||||
long ut_size = sizeof(ut); /* avoid nonsense */
|
long ut_size = sizeof(ut); /* avoid nonsense */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user