Fixes for dtlogin and dtcm on FreeBSD.
authorUlrich Wilkens <mail@uwilkens.de>
Wed, 5 Sep 2012 14:26:28 +0000 (16:26 +0200)
committerJon Trulson <jon@radscan.com>
Thu, 6 Sep 2012 01:27:45 +0000 (19:27 -0600)
cde/programs/dtcm/dtcm/cm_i18n.c
cde/programs/dtcm/dtcm/deskset.c
cde/programs/dtlogin/account.c
cde/programs/dtlogin/dm.c
cde/programs/dtlogin/fontpath.c
cde/programs/dtlogin/session.c

index 54fa5c6e20007a29a103d53a2e2bcf07868703ba..0b15d2f6439aafc6790e6c6f503b610b68ccc796 100644 (file)
@@ -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. */
 
index 2eb47bd0acd03ce31bb24c528b55de75d13b3244..17fb20aa2225618db03c5b685e0d0cd39bc11002 100644 (file)
@@ -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 */
 
index e14389d43cad1603fc0dfd776c1503da46031d5a..649161df86aebc40072e37a1ae4c8547263e1536 100644 (file)
 #endif
 
 #include       <fcntl.h>
+#if defined(__FreeBSD__)
+#include       <utmpx.h>
+#else
 #include       <utmp.h>
+#endif
+
 #include       <time.h>
 #include       "dm.h"
 
index 52bcb902f5accb81a6c62f528a248bc48bdea8fd..3c9fc6e60568dc3e04faed00433a69e7db9b6414 100644 (file)
@@ -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")) {
index c37e2b8373389bf1835e8db17d81b7f8c812fd76..43173ba14a84f066714247046edc956a40e7ad0c 100644 (file)
 # include <signal.h>
 # include <X11/Xatom.h>
 # include <setjmp.h>
+#if defined(__FreeBSD__)
+# include <utmpx.h>
+#else
 # include <utmp.h>
+#endif
 # include "vgproto.h"
 
 /* 
index a1fbaa6a57e899768766938a1036560fda4a6c1e..57e73948ed75de478a2615ee205af9acd6bb1c82 100644 (file)
 # 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>