summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-04-13 00:14:09 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2021-04-13 00:14:09 +0000
commit5ad5826db13626e5ee48aff2e58bbd0ce5ef0637 (patch)
tree078786d5ea128d2a5755d798fac88aa5b6724eec /src
parent941864352b8bbda9c166025448b8f46153824d22 (diff)
downloadutmps-5ad5826db13626e5ee48aff2e58bbd0ce5ef0637.tar.xz
Only onestepback() before pututxline()
Diffstat (limited to 'src')
-rw-r--r--src/utmps/utmps-utmpd.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/utmps/utmps-utmpd.c b/src/utmps/utmps-utmpd.c
index af77a06..101e3ad 100644
--- a/src/utmps/utmps-utmpd.c
+++ b/src/utmps/utmps-utmpd.c
@@ -121,12 +121,6 @@ static void do_getent (void)
answer(ESRCH) ;
return ;
}
- if (!onestepback())
- {
- unlockit() ;
- answer(errno) ;
- return ;
- }
unlockit() ;
utmps_utmpx_unpack(buf+1, &b) ;
utmps_utmpx_pack(buf+1, &b) ;
@@ -156,18 +150,11 @@ static void do_getid (void)
utmps_utmpx_unpack(sbuf+1, &b) ;
if (idmatch(type, rbuf + USHORT_PACK, &b)) break ;
}
- if (!onestepback())
- {
- unlockit() ;
- answer(errno) ;
- return ;
- }
unlockit() ;
buffer_putnoflush(buffer_1small, sbuf, 1 + sizeof(struct utmpx)) ;
flush1() ;
}
-
static void do_getline (void)
{
char rbuf[UTMPS_UT_LINESIZE] ;
@@ -189,12 +176,6 @@ static void do_getline (void)
if ((b.ut_type == LOGIN_PROCESS || b.ut_type == USER_PROCESS)
&& !strncmp(rbuf, b.ut_line, UTMPS_UT_LINESIZE - 1)) break ;
}
- if (!onestepback())
- {
- unlockit() ;
- answer(errno) ;
- return ;
- }
unlockit() ;
buffer_putnoflush(buffer_1small, sbuf, 1 + sizeof(struct utmpx)) ;
flush1() ;
@@ -213,6 +194,7 @@ static void do_putline (uid_t uid, gid_t gid)
utmps_utmpx_unpack(buf, &u) ;
maybe_open() ;
lockit(1) ;
+ onestepback() ; /* compatibility with glibc implementation */
for (;;)
{
struct utmpx b ;