diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c index 136ac69..a35bb2b 100644 --- a/libc/misc/utmp/utent.c +++ b/libc/misc/utmp/utent.c @@ -34,7 +34,7 @@ static const char default_file_name[] = _PATH_UTMP; static const char *static_ut_name = default_file_name; /* This function must be called with the LOCK held */ -static void __setutent_nolock(void) +static void __setutent_unlocked(void) { if (static_fd < 0) { static_fd = open_not_cancel_2(static_ut_name, O_RDWR | O_CLOEXEC); @@ -56,12 +56,12 @@ static void __setutent_nolock(void) static void __setutent(void) { __UCLIBC_MUTEX_LOCK(utmplock); - __setutent_nolock(); + __setutent_unlocked(); __UCLIBC_MUTEX_UNLOCK(utmplock); } #else static void __setutent(void); -strong_alias(__setutent_nolock,__setutent) +strong_alias(__setutent_unlocked,__setutent) #endif strong_alias(__setutent,setutent) @@ -70,7 +70,7 @@ strong_alias(__setutent,setutxent) #endif /* This function must be called with the LOCK held */ -static struct utmp *__getutent_lock(void) +static struct utmp *__getutent_unlocked(void) { if (static_fd < 0) { __setutent(); @@ -91,13 +91,13 @@ static struct utmp *__getutent(void) struct utmp *ret; __UCLIBC_MUTEX_LOCK(utmplock); - ret = __getutent_lock(); + ret = __getutent_unlocked(); __UCLIBC_MUTEX_UNLOCK(utmplock); return ret; } #else static struct utmp *__getutent(void); -strong_alias(__getutent_lock,__getutent) +strong_alias(__getutent_unlocked,__getutent) #endif strong_alias(__getutent,getutent) @@ -123,7 +123,7 @@ strong_alias(__endutent,endutxent) #endif /* This function must be called with the LOCK held */ -static struct utmp *__getutid_lock(const struct utmp *utmp_entry) +static struct utmp *__getutid_unlocked(const struct utmp *utmp_entry) { struct utmp *lutmp; unsigned type; @@ -133,7 +133,7 @@ static struct utmp *__getutid_lock(const struct utmp *utmp_entry) type = utmp_entry->ut_type - 1; type /= 4; - while ((lutmp = __getutent()) != NULL) { + while ((lutmp = __getutent_unlocked()) != NULL) { if (type == 0 && lutmp->ut_type == utmp_entry->ut_type) { /* one of RUN_LVL, BOOT_TIME, NEW_TIME, OLD_TIME */ return lutmp; @@ -152,13 +152,13 @@ static struct utmp *__getutid(const struct utmp *utmp_entry) struct utmp *ret; __UCLIBC_MUTEX_LOCK(utmplock); - ret = __getutid_lock(utmp_entry); + ret = __getutid_unlocked(utmp_entry); __UCLIBC_MUTEX_UNLOCK(utmplock); return ret; } #else static struct utmp *__getutid(const struct utmp *utmp_entry); -strong_alias(__getutid_lock,__getutid) +strong_alias(__getutid_unlocked,__getutid) #endif strong_alias(__getutid,getutid) @@ -174,7 +174,7 @@ static struct utmp *__getutline(const struct utmp *utmp_entry) struct utmp *lutmp; __UCLIBC_MUTEX_LOCK(utmplock); - while ((lutmp = __getutent()) != NULL) { + while ((lutmp = __getutent_unlocked()) != NULL) { if (lutmp->ut_type == USER_PROCESS || lutmp->ut_type == LOGIN_PROCESS) { if (strncmp(lutmp->ut_line, utmp_entry->ut_line, sizeof(lutmp->ut_line)) == 0) { break; @@ -200,7 +200,7 @@ static struct utmp *__pututline(const struct utmp *utmp_entry) the file pointer where they want it, everything will work out. */ lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR); - if (__getutid(utmp_entry) != NULL) + if (__getutid_unlocked(utmp_entry) != NULL) lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR); else lseek(static_fd, (off_t) 0, SEEK_END);