OSDN Git Service

libc_utmp: Fix getutmp and getutmpx for x86_64
authorCarmelo Amoroso <carmelo.amoroso@st.com>
Sun, 28 Nov 2010 19:44:21 +0000 (20:44 +0100)
committerCarmelo Amoroso <carmelo.amoroso@st.com>
Sun, 28 Nov 2010 19:50:38 +0000 (20:50 +0100)
commit5dea871ac73ef4608022c058b50adc946917f9b9
treef93f49010cc7de4f626b1b4d5e2110b74acd92e3
parenta11fcabb4a6a1a384363329ebdb3569a1df246f8
libc_utmp: Fix getutmp and getutmpx for x86_64

On x86_64, when WORDSIZE_COMPAT32 is enabled, the ut_tv field
of 'struct utmp' and 'struct utmpx' are defined as two nested structs
instead of being defined as 'struct timeval', so it is not possible to
directly assign the two ut_tv values.
This patch split the assignment by setting each fields (tv_sec, tv_usec)
of the ut_tv filed separately
It is als compatible with 'struct timeval' usage.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
libc/misc/utmp/utxent.c