Hello,
here's a patch that might be worth to go into the upcoming tar ball.
It's not quite finished but at least it's an improvement.

dtlogin works for both 32 and 64 bit, but the utpmx support is not ready. But it seems to me that utmp/utmpx needs some work anyway.

dtcm also works, but the required rpc.cmsd sometimes doesn't start
from inetd. In this case it can be started manually.

bye, Ulrich


--
Ulrich Wilkens
Email: m...@uwilkens.de

>From b18c5e6360ce02259b86ab08ea80cb23972ec42d Mon Sep 17 00:00:00 2001
From: Ulrich Wilkens <m...@uwilkens.de>
Date: Wed, 5 Sep 2012 16:26:28 +0200
Subject: [PATCH] Fixes for dtlogin and dtcm on FreeBSD.

---
 cde/programs/dtcm/dtcm/cm_i18n.c |    2 ++
 cde/programs/dtcm/dtcm/deskset.c |    6 +++---
 cde/programs/dtlogin/account.c   |    5 +++++
 cde/programs/dtlogin/dm.c        |    9 +++++++++
 cde/programs/dtlogin/fontpath.c  |    4 ++++
 cde/programs/dtlogin/session.c   |    4 ++++
 6 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/cde/programs/dtcm/dtcm/cm_i18n.c b/cde/programs/dtcm/dtcm/cm_i18n.c
index 54fa5c6..0b15d2f 100644
--- a/cde/programs/dtcm/dtcm/cm_i18n.c
+++ b/cde/programs/dtcm/dtcm/cm_i18n.c
@@ -388,6 +388,8 @@ cm_printf(double value, int decimal_pt)
        }
 #ifdef SunOS
        fconvert(value, decimal_pt, &deci_pt, &sign, buf);
+#elif defined(__FreeBSD__)
+       snprintf(buf, decimal_pt, "%f", value);
 #else
        /* this version, available on the HP and AIX machine is not reentrant. 
*/
 
diff --git a/cde/programs/dtcm/dtcm/deskset.c b/cde/programs/dtcm/dtcm/deskset.c
index 2eb47bd..17fb20a 100644
--- a/cde/programs/dtcm/dtcm/deskset.c
+++ b/cde/programs/dtcm/dtcm/deskset.c
@@ -132,7 +132,7 @@ ds_position_popup(Widget base, Widget popup, ds_location_op 
location_op) {
                 XmNy,      &base_y,
                 XmNwidth,  &base_width,
                 XmNheight, &base_height,
-                0) ;
+                NULL) ;
   bx = (int) base_x ;
   by = (int) base_y ;
   bw = (int) base_width ;
@@ -143,7 +143,7 @@ ds_position_popup(Widget base, Widget popup, ds_location_op 
location_op) {
                 XmNy,      &popup_y,
                 XmNwidth,  &popup_width,
                 XmNheight, &popup_height,
-                0) ;
+                NULL) ;
 
   px = (int) popup_x ;
   py = (int) popup_y ;
@@ -232,7 +232,7 @@ ds_force_popup_on_screen(Widget popup, int *popup_x_p, int 
*popup_y_p) {
   XtVaGetValues(popup,
                 XmNwidth,  &popup_width,
                 XmNheight, &popup_height,
-                0) ;
+                NULL) ;
 
 /* Make sure frame does not go off side of screen */
 
diff --git a/cde/programs/dtlogin/account.c b/cde/programs/dtlogin/account.c
index e14389d..649161d 100644
--- a/cde/programs/dtlogin/account.c
+++ b/cde/programs/dtlogin/account.c
@@ -57,7 +57,12 @@
 #endif
 
 #include       <fcntl.h>
+#if defined(__FreeBSD__)
+#include       <utmpx.h>
+#else
 #include       <utmp.h>
+#endif
+
 #include       <time.h>
 #include       "dm.h"
 
diff --git a/cde/programs/dtlogin/dm.c b/cde/programs/dtlogin/dm.c
index 52bcb90..3c9fc6e 100644
--- a/cde/programs/dtlogin/dm.c
+++ b/cde/programs/dtlogin/dm.c
@@ -1697,8 +1697,13 @@ GettyMessage( struct display *d, int msgnum )
 int 
 GettyRunning( struct display *d )
 {
+#if defined(__FreeBSD__)
+    struct utmpx utmp;         /* local struct for new entry              */
+    struct utmpx *u;           /* pointer to entry in utmp file           */
+#else
     struct utmp utmp;          /* local struct for new entry              */
     struct utmp *u;            /* pointer to entry in utmp file           */
+#endif
     
     int                rvalue;         /* return value (TRUE or FALSE)         
   */
     char       buf[32];
@@ -1717,7 +1722,11 @@ GettyRunning( struct display *d )
         return FALSE;
 
 
+#if defined(__FreeBSD__)
+    bzero(&utmp, sizeof(struct utmpx));
+#else
     bzero(&utmp, sizeof(struct utmp));
+#endif
 
 #ifdef _AIX
    if (!strcmp(d->gettyLine,"console")) {
diff --git a/cde/programs/dtlogin/fontpath.c b/cde/programs/dtlogin/fontpath.c
index c37e2b8..43173ba 100644
--- a/cde/programs/dtlogin/fontpath.c
+++ b/cde/programs/dtlogin/fontpath.c
@@ -39,7 +39,11 @@
 # include <signal.h>
 # include <X11/Xatom.h>
 # include <setjmp.h>
+#if defined(__FreeBSD__)
+# include <utmpx.h>
+#else
 # include <utmp.h>
+#endif
 # include "vgproto.h"
 
 /* 
diff --git a/cde/programs/dtlogin/session.c b/cde/programs/dtlogin/session.c
index a1fbaa6..57e7394 100644
--- a/cde/programs/dtlogin/session.c
+++ b/cde/programs/dtlogin/session.c
@@ -65,7 +65,11 @@
 # include <signal.h>
 # include <X11/Xatom.h>
 # include <setjmp.h>
+#if defined(__FreeBSD__)
+# include <utmpx.h>
+#else
 # include <utmp.h>
+#endif
 #include <unistd.h>
 #include <pwd.h>
 #include <dirent.h>
-- 
1.7.8

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to