summaryrefslogtreecommitdiffstats
path: root/tdm
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2015-06-12 02:56:58 +0200
committerSlávek Banko <slavek.banko@axis.cz>2015-06-12 02:56:58 +0200
commit08122b137e76ffcf7067f634a7668002732e11d9 (patch)
tree30507bd9b39b46525b8941f1986dff2fa30f03af /tdm
parente1d8ccc637042d5ab84b0d532590f4cf8ef8e567 (diff)
downloadtdebase-08122b137e76ffcf7067f634a7668002732e11d9.tar.gz
tdebase-08122b137e76ffcf7067f634a7668002732e11d9.zip
Fix FTBFS on freebsd
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'tdm')
-rw-r--r--tdm/backend/CMakeLists.txt2
-rw-r--r--tdm/backend/dm.h8
-rw-r--r--tdm/backend/getfd.c2
-rw-r--r--tdm/backend/sessreg.c9
-rw-r--r--tdm/kfrontend/gentdmconf.c12
-rw-r--r--tdm/kfrontend/kgreeter.cpp5
6 files changed, 29 insertions, 9 deletions
diff --git a/tdm/backend/CMakeLists.txt b/tdm/backend/CMakeLists.txt
index 9f9d0430..da3f3ac0 100644
--- a/tdm/backend/CMakeLists.txt
+++ b/tdm/backend/CMakeLists.txt
@@ -43,6 +43,6 @@ tde_add_executable( tdm
process.c protodpy.c reset.c resource.c rpcauth.c
server.c session.c sessreg.c socket.c streams.c
util.c xdmauth.c xdmcp.c
- LINK X11 ${XAU_LIBRARIES} ${DBUS_LIBRARIES} ${CRYPT_LIBRARY} ${PAM_LIBRARY} ${XDMCP_LIBRARIES}
+ LINK X11 ${XAU_LIBRARIES} ${DBUS_LIBRARIES} ${CRYPT_LIBRARY} ${PAM_LIBRARY} ${UTIL_LIBRARY} ${XDMCP_LIBRARIES}
DESTINATION ${BIN_INSTALL_DIR}
)
diff --git a/tdm/backend/dm.h b/tdm/backend/dm.h
index c05d4c86..ae731aec 100644
--- a/tdm/backend/dm.h
+++ b/tdm/backend/dm.h
@@ -106,7 +106,6 @@ typedef int waitType;
# define Jmp_buf sigjmp_buf
#endif
-#include <utmp.h>
#ifdef HAVE_UTMPX
# include <utmpx.h>
# define STRUCTUTMP struct utmpx
@@ -119,6 +118,7 @@ typedef int waitType;
# define ut_time ut_tv.tv_sec
# define ll_time ll_tv.tv_sec
#else
+# include <utmp.h>
# define STRUCTUTMP struct utmp
# define UTMPNAME utmpname
# define SETUTENT setutent
@@ -126,9 +126,9 @@ typedef int waitType;
# define PUTUTLINE pututline
# define ENDUTENT endutent
# define LASTLOG lastlog
-#endif
-#ifndef HAVE_STRUCT_UTMP_UT_USER
-# define ut_user ut_name
+# ifndef HAVE_STRUCT_UTMP_UT_USER
+# define ut_user ut_name
+# endif
#endif
#ifndef WTMP_FILE
# ifdef _PATH_WTMPX
diff --git a/tdm/backend/getfd.c b/tdm/backend/getfd.c
index 307b2501..d4f4d835 100644
--- a/tdm/backend/getfd.c
+++ b/tdm/backend/getfd.c
@@ -22,7 +22,7 @@ is_a_console(int fd) {
char arg;
arg = 0;
-#ifdef __OpenBSD__
+#if defined(__OpenBSD__) || defined(__FreeBSD__)
return arg;
#else
return (ioctl(fd, KDGKBTYPE, &arg) == 0
diff --git a/tdm/backend/sessreg.c b/tdm/backend/sessreg.c
index b507f814..4167a16e 100644
--- a/tdm/backend/sessreg.c
+++ b/tdm/backend/sessreg.c
@@ -42,6 +42,13 @@ from The Open Group.
#if defined(__svr4__) || defined(__Lynx__) || defined(__QNX__) || defined(__APPLE__) || defined(_SEQUENT_) /*|| defined(USE_PAM)*/
# define NO_LASTLOG
#endif
+
+#ifdef __FreeBSD__
+# include <sys/param.h>
+# if __FreeBSD_version >= 900007
+# define NO_LASTLOG
+# endif
+#endif
#ifndef NO_LASTLOG
# ifdef HAVE_LASTLOG_H
@@ -254,7 +261,9 @@ sessreg( struct display *d, int pid, const char *user, int uid )
close( utmp );
}
# else
+# if !defined(__FreeBSD__)
UTMPNAME( UTMP_FILE );
+# endif
SETUTENT();
PUTUTLINE( &ut_ent );
ENDUTENT();
diff --git a/tdm/kfrontend/gentdmconf.c b/tdm/kfrontend/gentdmconf.c
index 9a7bc125..0576eef5 100644
--- a/tdm/kfrontend/gentdmconf.c
+++ b/tdm/kfrontend/gentdmconf.c
@@ -44,7 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <limits.h>
#include <sys/stat.h>
#include <sys/param.h>
-#ifdef BSD
+#if defined(BSD) && !defined(HAVE_UTMPX)
# include <utmp.h>
#endif
@@ -1537,8 +1537,13 @@ edit_startup( File *file )
"fi\n") |
#else
# ifdef BSD
+# ifdef HAVE_UTMPX
+ delstr( file, "\n"
+"exec sessreg -a -l $DISPLAY -x */Xservers $USER\n" ) |
+# else
delstr( file, "\n"
"exec sessreg -a -l $DISPLAY -x */Xservers -u " _PATH_UTMP " $USER\n" ) |
+# endif
# endif
#endif /* _AIX */
delstr( file, "\n"
@@ -1586,8 +1591,13 @@ edit_reset( File *file )
"fi\n" ) |
#else
# ifdef BSD
+# ifdef HAVE_UTMPX
+ delstr( file, "\n"
+"exec sessreg -d -l $DISPLAY -x */Xservers $USER\n" ) |
+# else
delstr( file, "\n"
"exec sessreg -d -l $DISPLAY -x */Xservers -u " _PATH_UTMP " $USER\n" ) |
+# endif
# endif
#endif /* _AIX */
delstr( file, "\n"
diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp
index 74e04bf3..aa89fd78 100644
--- a/tdm/kfrontend/kgreeter.cpp
+++ b/tdm/kfrontend/kgreeter.cpp
@@ -70,9 +70,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
-#include <utmp.h>
#ifdef HAVE_UTMPX
-#include <utmpx.h>
+# include <utmpx.h>
+#else
+# include <utmp.h>
#endif
#include <stdio.h>