--- oobs/oobs-user.c.orig 2007-10-30 09:16:53.406333206 -0400 +++ oobs/oobs-user.c 2007-10-30 09:40:02.560797530 -0400 @@ -18,13 +18,28 @@ * Authors: Carlos Garnacho Parro */ +#if defined(HAVE_CONFIG_H) +#include +#endif + +#ifdef __FreeBSD__ +# include +# if __FreeBSD_version >= 900007 +# define HAVE_UTMPX_H +# endif +#endif + #include #include #include #include #include +#ifdef HAVE_CRYPT_H #include -#include +#endif +#ifdef HAVE_UTMPX_H +#include +#endif #include "oobs-usersconfig.h" #include "oobs-user.h" @@ -811,7 +826,8 @@ gboolean oobs_user_get_active (OobsUser *user) { - struct utmp *entry; +#ifdef HAVE_UTMPX_H + struct utmpx *entry; const gchar *login; gboolean match = FALSE; @@ -819,14 +835,18 @@ login = oobs_user_get_login_name (user); - while (!match && (entry = getutent ()) != NULL) + setutxent (); + while (!match && (entry = getutxent ()) != NULL) { match = (entry->ut_type == USER_PROCESS && strcmp (entry->ut_user, login) == 0); } /* close utmp */ - endutent (); + endutxent (); return match; +#else + return FALSE; +#endif }