This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: PATCH: Fix __WORDSIZE for ia64.
On Fri, Aug 01, 2003 at 04:06:51PM -0700, Dan Kegel wrote:
> H. J. Lu wrote:
> > Gwenole wrote:
> >> - Because of the new struct utmp layout, the following packages had
> >> to be fixed and/or rebuilt: adjtimex, aterm, dietlibc, dump,
> >> emacs, fileutils, findutils, finger, getty_ps, gkrellm,
> >> gnome-libs, gpm, hylafax, kdeadmin, kdebase, kdenetwork,
> >> kdevelop, krb5, libzvt, linuxconf, man-pages, mgetty, mingetty,
> >> mod_auth_external, ncpfs, ntp, openssh, pam, procps, proftpd,
> >> psacct, pwdb, rwho, rxvt, samba, screen, shadow-utils, sh-utils,
> >> sysklogd, SysVinit, talk, tcsh, utempter, util-linux, xterm, zsh,
> >> XFree86.
> >>Once I get time, I will check those not yet sent upstream. Or, in the
> >>mean time, you can check:
> >>http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/SPECS/<package-name>/*-
> >>biarch-utmp.patch
> >
> >This doesn't mean much. I don't believe all of them access utmp/wtmp
> >directly. I will provide old versioned interface so that those who
> >access utmp/wtmp via libc should work fine.
>
> Think so? Check out one of the many *-biarch-utmp.patch files.
> It looks like you might have to do some work even on programs that
> go through libc.
>
> --- sysvinit-2.83/src/utmp.c.biarch-utmp 2003-04-05
> 19:17:02.000000000 +0200
> +++ sysvinit-2.83/src/utmp.c 2003-04-05 19:30:54.000000000 +0200
> @@ -76,9 +76,17 @@ char *line) /* Which line is this */
> */
> memset(&utmp, 0, sizeof(utmp));
> #if defined(__GLIBC__)
> - gettimeofday(&utmp.ut_tv, NULL);
> + if (sizeof (utmp.ut_tv) == sizeof (struct timeval))
> + gettimeofday((struct timeval *) &utmp.ut_tv, NULL);
> + else
> + {
> + struct timeval tv;
> + gettimeofday(&tv, NULL);
> + utmp.ut_tv.tv_sec = tv.tv_sec;
> + utmp.ut_tv.tv_usec = tv.tv_usec;
> + }
I think it should be
#if defined(__GLIBC__)
{
struct timeval tv;
gettimeofday(&tv, NULL);
utmp.ut_tv.tv_sec = tv.tv_sec;
utmp.ut_tv.tv_usec = tv.tv_usec;
}
#else
...
#endif
H.J.