$NetBSD: patch-ac,v 1.3 2009/07/12 10:33:12 hasso Exp $ --- oobs/oobs-user.c.orig 2008-01-02 16:23:56 +0200 +++ oobs/oobs-user.c 2009-07-12 10:44:15 +0300 @@ -18,13 +18,29 @@ * Authors: Carlos Garnacho Parro */ +#if defined(HAVE_CONFIG_H) +#include +#endif + #include #include #include #include #include +#ifdef HAVE_CRYPT_H #include +#endif +#ifndef __NetBSD__ #include +#define UTMP utmp +#define GETUTENT getutent +#define ENDUTENT endutent +#else +#include +#define UTMP utmpx +#define GETUTENT getutxent +#define ENDUTENT endutxent +#endif #include "oobs-usersconfig.h" #include "oobs-user.h" @@ -804,7 +820,7 @@ oobs_user_set_other_data (OobsUser *user gboolean oobs_user_get_active (OobsUser *user) { - struct utmp *entry; + struct UTMP *entry; const gchar *login; gboolean match = FALSE; @@ -812,14 +828,16 @@ oobs_user_get_active (OobsUser *user) login = oobs_user_get_login_name (user); - while (!match && (entry = getutent ()) != NULL) +#if !defined(__FreeBSD__) && !defined(__DragonFly__) + while (!match && (entry = GETUTENT ()) != NULL) { match = (entry->ut_type == USER_PROCESS && strcmp (entry->ut_user, login) == 0); } /* close utmp */ - endutent (); + ENDUTENT (); return match; +#endif }