4.3.1 build fails in Cygwin: 'struct utmp' has no member named 'ut_tv'

Andrew Schulman <[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <[email protected]>
Subject says it.  Build log excerpt:

gcc -c -I.
-I/home/andrex/dev/cygwin/screen/screen-4.3.1-1.x86_64/src/screen-4.3.1
-DETCSCREENRC='"/etc/screenrc"'
-DSCREENENCODINGS='"/usr/share/screen/utf8encodings"' -DHAVE_CONFIG_H
-DGIT_REV=\""`git describe --always 2>/dev/null`"\" \
     -ggdb -O2 -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/home/andrex/dev/cygwin/screen/screen-4.3.1-1.x86_64/build=/usr/src/debug/screen-4.3.1-1
-fdebug-prefix-map=/home/andrex/dev/cygwin/screen/screen-4.3.1-1.x86_64/src/screen-4.3.1=/usr/src/debug/screen-4.3.1-1
-D_GNU_SOURCE
/home/andrex/dev/cygwin/screen/screen-4.3.1-1.x86_64/src/screen-4.3.1/utmp.c
/home/andrex/dev/cygwin/screen/screen-4.3.1-1.x86_64/src/screen-4.3.1/utmp.c: In
function 'makeuser':
/home/andrex/dev/cygwin/screen/screen-4.3.1-1.x86_64/src/screen-4.3.1/utmp.c:634:4:
error: 'struct utmp' has no member named 'ut_tv'
   u->ut_tv.tv_sec = now;
    ^
Makefile:82: recipe for target 'utmp.o' failed
make: *** [utmp.o] Error 1
*** ERROR: make failed


And indeed, in Cygwin struct utmp doesn't include ut_tv.  From
/usr/include/sys/utmp.h:

struct utmp
{
 short  ut_type;
 pid_t  ut_pid;
 char   ut_line[UT_LINESIZE];
 char  ut_id[UT_IDLEN];
 time_t ut_time;
 char   ut_user[UT_NAMESIZE];
 char   ut_host[UT_HOSTSIZE];
 long   ut_addr;
};

The problem comes in utmp.c, which has a couple of instances of

  (void)time(&now);
  u->ut_tv.tv_sec = now;

What's the best way to proceed here?

Thanks,
Andrew
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.