diff options
author | kwm <kwm@df743ca5-7f9a-e211-a948-0013205c9059> | 2010-01-19 19:23:42 +0800 |
---|---|---|
committer | kwm <kwm@df743ca5-7f9a-e211-a948-0013205c9059> | 2010-01-19 19:23:42 +0800 |
commit | 034937b3a656cc6850a215b7163970dd614039c9 (patch) | |
tree | 216ea009898154aadc3122fc9b05ce0f693e9b38 /devel | |
parent | 15ecf9fe31e0b75ac94b518088bd58ef832f0328 (diff) | |
download | marcuscom-ports-034937b3a656cc6850a215b7163970dd614039c9.tar marcuscom-ports-034937b3a656cc6850a215b7163970dd614039c9.tar.gz marcuscom-ports-034937b3a656cc6850a215b7163970dd614039c9.tar.bz2 marcuscom-ports-034937b3a656cc6850a215b7163970dd614039c9.tar.lz marcuscom-ports-034937b3a656cc6850a215b7163970dd614039c9.tar.xz marcuscom-ports-034937b3a656cc6850a215b7163970dd614039c9.tar.zst marcuscom-ports-034937b3a656cc6850a215b7163970dd614039c9.zip |
Sync with ports.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@13488 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'devel')
-rw-r--r-- | devel/liboobs/files/patch-src_oobs-user.c | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/devel/liboobs/files/patch-src_oobs-user.c b/devel/liboobs/files/patch-src_oobs-user.c index 484b86f32..ec1ce8ce6 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 @@ +@@ -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 } |