File wait-status.patch of Package xview

xview on suse 15:  wait status
== to be applied after xview-debian.patch ==

in wait function args, always use 'int status' instead of 'union wait status'

--- xview-3.2p1.4/lib/libxview/base/base.h	2018-11-29 19:41:30.673202240 +0100
+++ xview-3.2p1.4/lib/libxview/base/base.h	2018-11-30 15:21:07.219574849 +0100
@@ -62,6 +62,7 @@
 #elif defined(__linux__)
 #define XV_OS_SVR4
 #undef XV_USE_TTCOMPAT
+#define SYSV_WAIT 
 #define SYSV_UCONTEXT 
 #define XV_USE_XVFCNTL 
 #endif
--- xview-3.2p1.4/lib/libxview/misc/expandname.c	2018-11-29 19:41:30.685202390 +0100
+++ xview-3.2p1.4/lib/libxview/misc/expandname.c	2018-11-30 15:11:28.812514712 +0100
@@ -121,7 +121,7 @@
 	length += status;
     }
     (void) close(pivec[0]);
-#ifndef SVR4
+#ifndef SYSV_WAIT
     while (wait((union wait *) & status) != pid);
 #else /* SVR4 */
     while (wait( & status) != pid);
--- xview-3.2p1.4/lib/libxview/notify/ndisd_wait.c	2018-11-29 19:41:30.689202438 +0100
+++ xview-3.2p1.4/lib/libxview/notify/ndisd_wait.c	2018-11-30 15:04:50.923674740 +0100
@@ -22,7 +22,7 @@
 notify_default_wait3(client, pid, status, rusage)
     Notify_client   client;
     int             pid;
-#ifndef SVR4
+#ifndef SYSV_WAIT
     union wait     *status;
 #else /* SVR4 */
     int *status;
--- xview-3.2p1.4/lib/libxview/notify/nintn_wait.c	2018-11-29 19:41:30.689202438 +0100
+++ xview-3.2p1.4/lib/libxview/notify/nintn_wait.c	2018-11-30 15:05:26.284105057 +0100
@@ -22,7 +22,7 @@
 notify_next_wait3_func(nclient, pid, status, rusage)
     Notify_client   nclient;
     int             pid;
-#ifndef SVR4
+#ifndef SYSV_WAIT
     union wait     *status;
 #else /* SVR4 */
     int *status;
--- xview-3.2p1.4/lib/libxview/notify/ntfy_test.c	1993-06-29 07:18:12.000000000 +0200
+++ xview-3.2p1.4/lib/libxview/notify/ntfy_test.c	2018-12-04 12:51:11.751892074 +0100
@@ -596,7 +596,7 @@
 nt_wait3_func(client, pid, status, rusage)
     CLIENT         *client;
     int             pid;
-#ifndef SVR4
+#if !defined(SVR4) && !defined(__linux__)
     union wait     *status;
 #else /* SVR4 */
     int     *status;
--- xview-3.2p1.4/lib/libxview/ttysw/tty.c	1993-06-29 07:17:12.000000000 +0200
+++ xview-3.2p1.4/lib/libxview/ttysw/tty.c	2018-11-30 15:10:15.839626091 +0100
@@ -534,7 +534,7 @@
 tty_quit_on_death(client, pid, status, rusage)
     caddr_t         client;
     int             pid;
-#ifndef SVR4
+#ifndef SYSV_WAIT
     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
+#ifndef SYSV_WAIT
     union wait     *status;
 #else
     int     *status;
--- xview-3.2p1.4/clients/olvwm-4.1/olwm.c	2018-11-30 15:43:56.261303262 +0100
+++ xview-3.2p1.4/clients/olvwm-4.1/olwm.c	2018-11-30 15:54:50.857785285 +0100
@@ -708,14 +708,17 @@
 void
 ReapChildren()
 {
-#ifdef SYSV
+#if defined(SYSV) || defined(__linux__)
         pid_t pid;
         int status;
 #else
-	int oldmask;
 	int pid;
 	union wait status;
 #endif
+#ifdef SYSV 
+#else
+	int oldmask;
+#endif
 
 	if (!deadChildren)
 		return;
@@ -730,7 +733,7 @@
 
 	while (1) {
 
-#ifdef SYSV
+#if defined(SYSV) || defined(__linux__)
                 pid = waitpid(-1, &status, WNOHANG);
 #else
                 pid = wait3(&status, WNOHANG, (struct rusage *)0);
--- xview-3.2p1.4/clients/olwm/olwm.c	2018-11-30 15:43:56.265303314 +0100
+++ xview-3.2p1.4/clients/olwm/olwm.c	2018-11-30 15:55:27.258255786 +0100
@@ -634,14 +634,17 @@
 void
 ReapChildren()
 {
-#ifdef SYSV
+#if defined(SYSV) || defined(__linux__)
         pid_t pid;
         int status;
 #else
-	int oldmask;
 	int pid;
 	union wait status;
 #endif
+#ifdef SYSV
+#else
+	int oldmask;
+#endif
 
 	if (!deadChildren)
 		return;
@@ -655,7 +658,7 @@
 
 	while (1) {
 
-#ifdef SYSV
+#if defined(SYSV) || defined(__linux__)
                 pid = waitpid(-1, &status, WNOHANG);
 #else
                 pid = wait3(&status, WNOHANG, (struct rusage *)0);
--- xview-3.2p1.4/contrib/examples/notifier/ntfy_pipe.c	1993-06-29 07:13:52.000000000 +0200
+++ xview-3.2p1.4/contrib/examples/notifier/ntfy_pipe.c	2018-12-04 10:44:13.730829966 +0100
@@ -169,7 +169,7 @@
 struct rusage *rusage; /* resources used by this process (unused) */
 {
     if (WIFEXITED(*status)) {
-#ifdef SVR4
+#if defined(SVR4) || defined(__linux__)
         printf("Process termined with status %d\n", *status);
 #else
         printf("Process termined with status %d\n", status->w_retcode);
openSUSE Build Service is sponsored by