summaryrefslogtreecommitdiffstats
path: root/devel/liboobs/files/patch-src_oobs-user.c
blob: a7215c4effbb859f4a1306980dce605fb8a8f50c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- oobs/oobs-user.c.orig   2010-01-31 17:36:52.000000000 +0000
+++ oobs/oobs-user.c    2010-01-31 17:40:21.000000000 +0000
@@ -19,13 +19,24 @@
  *          Milan Bouchet-Valat <nalimilan@club.fr>.
  */
 
+#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>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_CRYPT_H
 #include <crypt.h>
+#endif
+#ifdef HAVE_UTMPX_H
 #include <utmpx.h>
+#endif
 
 #include "oobs-object-private.h"
 #include "oobs-usersconfig.h"
@@ -1252,6 +1263,7 @@ oobs_user_set_locale (OobsUser *user, co
 gboolean
 oobs_user_get_active (OobsUser *user)
 {
+#ifdef HAVE_UTMPX_H
   struct utmpx *entry;
   const gchar *login;
   gboolean match = FALSE;
@@ -1272,6 +1284,9 @@ oobs_user_get_active (OobsUser *user)
   endutxent ();
 
   return match;
+#else
+  return FALSE;
+#endif
 }
 
 /**