pkgsrc/x11/xautolock/patches/patch-aa
joerg ba06453866 Fix compilation with GCC 3.4+. Let imake decide where to place
the man page, don't install it twice. Bump revision.
2005-12-04 01:17:43 +00:00

68 lines
1.7 KiB
Text

$NetBSD: patch-aa,v 1.5 2005/12/04 01:17:43 joerg Exp $
--- xautolock.c.orig 1999-03-11 22:43:25.000000000 +0000
+++ xautolock.c
@@ -297,6 +297,8 @@
* with vroot.h, because it needs to know the real root window.
*/
+#include <sys/param.h>
+
#if defined(hpux) || defined (__hpux)
#ifndef _HPUX_SOURCE
#define _HPUX_SOURCE
@@ -368,7 +370,11 @@
#endif /* !NOSTDHDRS */
#if !defined (apollo) && !defined (VMS)
+#if !defined (BSD)
#include <malloc.h>
+#endif /* !BSD */
+
+#include <fcntl.h>
#include <unistd.h>
#endif /* !apollo && !VMS */
@@ -1969,6 +1975,7 @@ Display* d; /* display pointer */
#ifdef __GNUC__
default: /* Makes gcc -Wall shut up. */
+ break;
#endif /* __GNUC__ */
}
}
@@ -2028,7 +2035,9 @@ Display* d; /* display pointer */
#else /* VMS */
if (locker_pid)
{
-#if !defined (UTEKV) && !defined (SYSV) && !defined(SVR4)
+#if defined (BSD)
+ int status;
+#elif !defined (UTEKV) && !defined (SYSV) && !defined(SVR4)
union wait status; /* childs process status */
#else /* !UTEKV && !SYSV && !SVR4 */
int status = 0; /* childs process status */
@@ -2762,8 +2771,23 @@ String argv[]; /* array of arguments
CheckConnectionAndSendMessage (d);
+#if !defined (apollo) && !defined (VMS)
+ if (close_out || close_err)
+ {
+ Int devnull;
+
+ devnull = open("/dev/null", O_WRONLY, 0);
+ if (devnull >= 0)
+ {
+ if (close_out) (Void) dup2(devnull, fileno(stdout));
+ if (close_err) (Void) dup2(devnull, fileno(stderr));
+ (Void) close(devnull);
+ }
+ }
+#else
if (close_out) (Void) fclose (stdout);
if (close_err) (Void) fclose (stderr);
+#endif
(Void) XSetErrorHandler ((XErrorHandler) CatchFalseAlarm);