syscalls: Adjust utmpx test.

Fixes <https://bugs.gnu.org/29426>.
Reported by Adonay Felipe Nogueira <adfeno@hyperbola.info>.

* tests/syscalls.scm ("utmpx-entries"): Check the value
of (utmpx-entries entry) only for INIT_PROCESS, LOGIN_PROCESS, and
USER_PROCESS entries.
This commit is contained in:
Ludovic Courtès 2017-11-25 17:22:32 +01:00
parent 1e0ea1d8df
commit 4aac8d059a
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 6 additions and 1 deletions

View File

@ -525,7 +525,12 @@
(every (lambda (entry)
(match (utmpx-user entry)
((? string?)
(or (eqv? (login-type BOOT_TIME) (utmpx-login-type entry))
;; Ensure we have a valid PID for those entries where it
;; makes sense.
(or (not (memv (utmpx-login-type entry)
(list (login-type INIT_PROCESS)
(login-type LOGIN_PROCESS)
(login-type USER_PROCESS))))
(> (utmpx-pid entry) 0)))
(#f ;might be DEAD_PROCESS
#t)))