Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Feb 2003 09:24:14 -0700 (MST)
From:      Hubert Bartels <hgb@catalina.opt-sci.Arizona.EDU>
To:        freebsd-ports@FreeBSD.org
Subject:   Patch for PR 43796 / xview doesn't build on 5.0
Message-ID:  <200302261624.h1QGOE814724@catalina.opt-sci.Arizona.EDU>

next in thread | raw e-mail | index | archive | help
>Number:        43796
>Category:      ports
>Synopsis:      Preliminary patches to build xview on 5.0

	I've been working on patches to get xview-3.2 running under 5.0
and -current. The following set of patches allow me to build and run a
small test program under 5.0. I've also tested them under 4.7 to make
sure they don't break anything there.

	These are preliminary patches as I'm still having problems with
some of the xview clients - the Open Look window manager appears to run
but cmdtool crashes immediately and when shelltool exits, it leaves
behind a Bus Error. I'm looking into these at the moment.

	I'd like other people to test and comment on these patches - it's
my first attempt at fixing port bugs and I'm unsure of how to get them
to the attention of the Powers That Be.

					Hubert Bartels
>Fix:
>-------------------------------------------------------------------------
--- lib/libxview/notify/ndisd_wait.c.orig       Sun Feb 23 20:05:10 2003
+++ lib/libxview/notify/ndisd_wait.c    Sun Feb 23 20:15:40 2003
@@ -22,11 +22,11 @@
 notify_default_wait3(client, pid, status, rusage)
     Notify_client   client;
     int             pid;
-#ifndef SVR4
+#if !defined(SVR4) && !(defined(BSD) && (BSD > 199103))
     union wait     *status;
-#else SVR4
+#else
     int *status;
-#endif SVR4
+#endif
     struct rusage  *rusage;
 {
     return (NOTIFY_IGNORED);
--- lib/libxview/notify/nintn_wait.c.orig       Sun Feb 23 20:08:09 2003
+++ lib/libxview/notify/nintn_wait.c    Sun Feb 23 20:17:15 2003
@@ -22,11 +22,11 @@
 notify_next_wait3_func(nclient, pid, status, rusage)
     Notify_client   nclient;
     int             pid;
-#ifndef SVR4
+#if !defined(SVR4) && !(defined(BSD) && (BSD > 199103))
     union wait     *status;
-#else SVR4
+#else
     int *status;
-#endif SVR4
+#endif
     struct rusage  *rusage;
 {
     Notify_func     func;
--- lib/libxview/notify/notify.h.orig   Sun Feb 23 20:18:23 2003
+++ lib/libxview/notify/notify.h        Sun Feb 23 20:20:57 2003
@@ -219,7 +219,7 @@

 #ifndef _NOTIFY_MIN_SYMBOLS

-#ifdef SYSV_WAIT
+#if !defined(SVR4) && (defined(BSD) && (BSD > 199103))
 EXTERN_FUNCTION (Notify_value   notify_default_wait3, (Notify_client nclient, int pid, int  *status, struct rusage
 *rusage));
 #define notify_default_waitpid notify_default_wait3
 #else
@@ -305,7 +305,7 @@
 EXTERN_FUNCTION (Notify_value  notify_next_output_func, (Notify_client nclient, int fd));
 EXTERN_FUNCTION (Notify_value  notify_next_signal_func, (Notify_client nclient, int signal, Notify_signal_mode mode));

-#ifdef SYSV_WAIT
+#if !defined(SVR4) && (defined(BSD) && (BSD > 199103))
 EXTERN_FUNCTION (Notify_value  notify_next_wait3_func, (Notify_client nclient, int pid, int  *status, struct rusage
 *rusage));
 #define notify_next_waitpid_func notify_next_wait3_func
 #else
--- lib/libxview/ttysw/tty.c.orig       Sun Feb 23 20:34:29 2003
+++ lib/libxview/ttysw/tty.c    Sun Feb 23 20:35:42 2003
@@ -534,7 +534,7 @@
 tty_quit_on_death(client, pid, status, rusage)
     caddr_t         client;
     int             pid;
-#ifndef SVR4
+#if !defined(SVR4) && !(defined(BSD) && (BSD > 199103))
     union wait     *status;
 #else
     int     *status;
@@ -586,7 +586,7 @@
 tty_handle_death(tty_folio_private, pid, status, rusage)
     Ttysw_folio     tty_folio_private;
     int             pid;
-#ifndef SVR4
+#if !defined(SVR4) && !(defined(BSD) && (BSD > 199103))
     union wait     *status;
 #else
     int     *status;
--- lib/libxview/notify/ntfy_fd_op.c.orig       Sun Feb 23 23:10:46 2003
+++ lib/libxview/notify/ntfy_fd_op.c    Sun Feb 23 23:15:16 2003
@@ -13,6 +13,10 @@
 #include <sys/types.h>
 #include <xview_private/ultrix_cpt.h>

+#ifndef howmany
+#define howmany( x, y) (((x) + ((y) - 1)) / (y))
+#endif
+
 /* AND op on two fds */
 int
 ntfy_fd_cmp_and(a, b)
--- lib/libxview/ttysw/termsw.c.orig    Sun Feb 23 21:51:02 2003
+++ lib/libxview/ttysw/termsw.c Sun Feb 23 21:51:27 2003
@@ -252,8 +252,7 @@

     /* Generate a new temporary file name and open the file up. */
     (void) strcpy(tmpfile_name, "/tmp/tty.txt.XXXXXX");
-    (void) mktemp(tmpfile_name);
-    if ((fd = open(tmpfile_name, O_CREAT | O_RDWR | O_EXCL, 0600)) < 0) {
+    if ((fd = mkstemp(tmpfile_name)) < 0) {
	return (XV_ERROR);
     }
     (void) close(fd);
--- lib/libxview/misc/gettext.c.orig    Sun Feb 23 22:00:06 2003
+++ lib/libxview/misc/gettext.c Sun Feb 23 22:03:53 2003
@@ -13,9 +13,6 @@
 char * dgettext(), *bindtextdomain();
 char *_gettext();
 char *fgets(), *getenv();
-#ifndef OS_HAS_MMAP
-caddr_t mmap();
-#endif

 static struct domain_binding *firstbind=0, *lastbind=0;

@@ -383,7 +380,7 @@
	close(fd);
	return (msg_id);
     } else if ((addr =
-       mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0))
+       (caddr_t) mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0))
	    == (caddr_t) -1 ) {
	close(fd);
	return (msg_id);
@@ -408,7 +405,7 @@
     /*
      * use mmap if on SunOS4.1 or later
      */
-    addr = mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0);
+    addr = (caddr_t) mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0);
 #else
     /*
      * use malloc if mmap is not available
--- clients/olwm/gettext.c.orig Sun Feb 23 22:18:57 2003
+++ clients/olwm/gettext.c      Sun Feb 23 22:19:52 2003
@@ -20,7 +20,6 @@
 char *_gettext();
 char *in_path();
 char *fgets(), *getenv();
-caddr_t mmap(), calloc();

 static struct domain_binding *firstbind=0, *lastbind=0;

@@ -338,7 +337,7 @@
	close(fd);
	return (msg_id);
     } else if ((addr =
-       mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0))
+       (caddr_t) mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0))
	    == (caddr_t) -1 ) {
	close(fd);
	return (msg_id);
@@ -358,7 +357,7 @@
     }

     fstat(fd, &statbuf);
-    addr = mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0);
+    addr = (caddr_t) mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0);
     close(fd);

     messages_so[first_free].mess_file_info = (struct struct_mo_info *) addr;
> --------------------------------------------------------------------------

----
Hubert Bartels         hgb@catalina.opt-sci.arizona.edu  (520)-621-2032
Optical Sciences Center   "Now, the first principle of self-defense is,
University of Arizona	   'Don't make people want to kill you'"
Tucson, AZ, USA 85721                                 - Miya Aston 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302261624.h1QGOE814724>