This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
FreeBSD port (15): utmp without ut_type
- From: Bruno Haible <bruno at clisp dot org>
- To: libc-alpha at sources dot redhat dot com
- Date: Wed, 10 Jul 2002 20:06:05 +0200 (CEST)
- Subject: FreeBSD port (15): utmp without ut_type
Hi,
In the FreeBSD port, I'm using the native utmp structure, which has no
ut_type, no ut_pid, no ut_id fields. The tst-utmp test doesn't even
compile for this case. Here is a patch to make it a nop for platforms
that don't have a modern 'struct utmp'.
2002-07-06 Bruno Haible <bruno@clisp.org>
* login/tst-utmp.c: Trivialize the test if testing 'struct utmp' and
!_HAVE_UT_TYPE.
diff -r -c3 glibc-20020627.bak/login/tst-utmp.c glibc-20020627/login/tst-utmp.c
--- glibc-20020627.bak/login/tst-utmp.c Tue Jul 10 22:59:11 2001
+++ glibc-20020627/login/tst-utmp.c Fri Jul 5 01:17:06 2002
@@ -1,5 +1,5 @@
/* Tests for UTMP functions.
- Copyright (C) 1998, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001-2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1998.
@@ -40,6 +40,8 @@
#endif
+#if _HAVE_UT_TYPE || defined UTMPX
+
/* Prototype for our test function. */
static int do_test (int argc, char *argv[]);
@@ -389,3 +391,14 @@
return result;
}
+
+#else
+
+/* No field 'ut_type' in struct utmp. */
+int
+main ()
+{
+ return 0;
+}
+
+#endif