diff options
author | Ed Schouten <ed@FreeBSD.org> | 2010-01-19 11:19:41 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2010-01-19 11:19:41 +0000 |
commit | f7d08914558a7d34d46911d1b5687ae14766748b (patch) | |
tree | 5abf1838fc3e99bcd2f55117eedf5689f3545e21 /devel/liboobs | |
parent | a050283a3222847730f530ee94b4d1b7478c0dd2 (diff) | |
download | ports-f7d08914558a7d34d46911d1b5687ae14766748b.tar.gz ports-f7d08914558a7d34d46911d1b5687ae14766748b.zip |
Fix build of liboobs on HEAD.
Now we have utmpx, we can easily enable the code that was previously
disabled. This patch (without the __FreeBSD_version bits) has been sent
to the upstream author and will likely be part of the next release.
Approved by: kwm
Notes
Notes:
svn path=/head/; revision=248148
Diffstat (limited to 'devel/liboobs')
-rw-r--r-- | devel/liboobs/files/patch-src_oobs-user.c | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/devel/liboobs/files/patch-src_oobs-user.c b/devel/liboobs/files/patch-src_oobs-user.c index 484b86f32e64..2096814ee3a6 100644 --- a/devel/liboobs/files/patch-src_oobs-user.c +++ b/devel/liboobs/files/patch-src_oobs-user.c @@ -1,6 +1,6 @@ ---- 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,12 +18,18 @@ +--- oobs/oobs-user.c ++++ oobs/oobs-user.c +@@ -18,13 +18,28 @@ * Authors: Carlos Garnacho Parro <carlosg@gnome.org> */ @@ -8,6 +8,13 @@ +#include <config.h> +#endif + ++#ifdef __FreeBSD__ ++# include <sys/param.h> ++# if __FreeBSD_version >= 900007 ++# define HAVE_UTMPX_H ++# endif ++#endif ++ #include <glib-object.h> #include <sys/types.h> #include <unistd.h> @@ -15,21 +22,42 @@ #include <string.h> +#ifdef HAVE_CRYPT_H #include <crypt.h> +-#include <utmp.h> ++#endif ++#ifdef HAVE_UTMPX_H ++#include <utmpx.h> +#endif - #include <utmp.h> #include "oobs-usersconfig.h" -@@ -852,6 +858,7 @@ + #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); -+#if 0 /* FreeBSD does not have ut_type in utmp */ - while (!match && (entry = getutent ()) != NULL) +- while (!match && (entry = getutent ()) != NULL) ++ setutxent (); ++ while (!match && (entry = getutxent ()) != NULL) { match = (entry->ut_type == USER_PROCESS && -@@ -862,4 +869,5 @@ - endutent (); + strcmp (entry->ut_user, login) == 0); + } + + /* close utmp */ +- endutent (); ++ endutxent (); return match; ++#else ++ return FALSE; +#endif } |