pkgsrc/security/srp_client/patches/patch-aj
joerg 58f24cc16e Fix errno. Force USE_TERMIO on DragonFly.
Hide ut assignment in utmp.c (patch-aj), it doesn't exist at least in the
code path DragonFly is taking.
2006-05-09 19:24:24 +00:00

82 lines
1.5 KiB
Text

$NetBSD: patch-aj,v 1.3 2006/05/09 19:24:24 joerg Exp $
--- base/libmisc/utmp.c.orig 1998-12-10 14:43:22.000000000 +1300
+++ base/libmisc/utmp.c
@@ -37,6 +37,12 @@
#include <utmpx.h>
#endif
+#if HAVE_UTMPX_H && defined(__NetBSD__)
+#undef HAVE_SETUTENT
+#undef HAVE_GETUTENT
+#undef HAVE_ENDUTENT
+#endif
+
#include <fcntl.h>
#include <stdio.h>
@@ -93,6 +99,10 @@ checkutmp (picky)
#endif
#endif
+#ifdef LOGIN_PROCESS /* USG */
+ ut = NULL;
+#endif
+
#if HAVE_UTMPX_H
setutxent ();
#endif
@@ -141,17 +151,21 @@ checkutmp (picky)
if (utx)
utxent = *utx;
#endif
+#if HAVE_GETUTENT
while ((ut = getutent()))
if (ut->ut_pid == pid)
break;
if (ut)
utent = *ut;
+#endif
#if HAVE_UTMPX_H
endutxent();
#endif
+#if HAVE_ENDUTENT
endutent();
+#endif
if (!ut) {
puts(NO_UTENT);
@@ -188,6 +202,7 @@ checkutmp (picky)
if (strncmp(line, "/dev/", 5) == 0)
line += 5;
+#if !defined(__NetBSD__)
strncpy (utent.ut_line, line, sizeof utent.ut_line);
if ((ut = getutline(&utent)))
strncpy(utent.ut_id, ut->ut_id, sizeof ut->ut_id);
@@ -206,6 +221,7 @@ checkutmp (picky)
gettimeofday((struct timeval *) &utxent.ut_tv, NULL);
utent.ut_time = utxent.ut_tv.tv_sec;
#endif
+#endif /* !NetBSD */
}
#else /* !USG */
@@ -283,6 +299,7 @@ setutmp (name, line)
break;
}
}
+#if HAVE_GETUTENT
while (utmp = getutent ()) {
if (utmp->ut_pid == pid) {
found_utmp = 1;
@@ -357,6 +374,7 @@ setutmp (name, line)
utxent = utxline;
utent = utline;
+#endif
#else /* !SVR4 */
struct utmp utmp;