21661553 Reduce parfait warnings in X builds s12_82
authorAlan Coopersmith <Alan.Coopersmith@Oracle.COM>
Wed, 19 Aug 2015 17:35:59 -0700
changeset 1568 f85b5a8a5c43
parent 1567 d638bfcf9ec2
child 1569 570c86581dc8
21661553 Reduce parfait warnings in X builds
open-src/app/accessx/sun-src/AccessX.c
open-src/app/cmap_alloc/sun-src/cmap_alloc.c
open-src/app/fbconsole/sun-src/fbconsole.c
open-src/app/gfx-utils/sun-src/fbconf_xorg/fbc/fbc_append_config.c
open-src/app/gfx-utils/sun-src/fbconf_xorg/fbc/fbc_predid.c
open-src/app/gfx-utils/sun-src/fbconfig/fbconfig.c
open-src/app/gfx-utils/sun-src/gfx_common/vts/gfx_vts.c
open-src/app/gfx-utils/sun-src/gfx_common/vts/include/gfx_vts.h
open-src/app/gfx-utils/sun-src/vts/ast/tools.c
open-src/app/gfx-utils/sun-src/vts/mga/tools.c
open-src/app/installalias/sun-src/installalias.c
open-src/app/xhost/xhost.patch
open-src/common/Makefile.init
open-src/common/X-parfait.conf
open-src/lib/libX11/im-suneu-greek.patch
open-src/lib/libX11/sun-src/modules/lc/gb18030/lcGB18030.c
open-src/lib/libXext/sun-src/src/XPanoramiX.c
open-src/lib/libXmu/Makefile
open-src/lib/libXp/6724993.patch
open-src/lib/libXp/Makefile
open-src/lib/libdga/sun-src/cmap_grab.c
open-src/lib/libdga/sun-src/dga_Xrequests.c
open-src/lib/libdga/sun-src/dga_internal.h
open-src/lib/libdga/sun-src/draw_db.c
open-src/lib/libdga/sun-src/draw_inquiry.c
open-src/lib/libdga/sun-src/pix_grab.c
open-src/lib/libdga/sun-src/win_grab.c
open-src/xserver/Makefile.inc
open-src/xserver/xorg/sun-src/IA/interactive.c
open-src/xserver/xorg/sun-src/os/dtlogin.c
open-src/xserver/xorg/sun-src/tsol/auditwrite.c
open-src/xserver/xorg/sun-src/tsol/tsolpolicy.c
open-src/xserver/xorg/sun-src/tsol/tsolutils.c
--- a/open-src/app/accessx/sun-src/AccessX.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/app/accessx/sun-src/AccessX.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,6 +1,6 @@
 /*
 *
-* Copyright (c) 1993, 2009, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 1993, 2015, Oracle and/or its affiliates. All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
@@ -2633,6 +2633,7 @@
 		    HELPDIR,ACCESSXHELP_FILE);
 		helpfilefp = fopen(helpfile, "r");
 		if (!helpfilefp) {
+			XtFree(helpfile);
 			return(False);
 		}
 	}
--- a/open-src/app/cmap_alloc/sun-src/cmap_alloc.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/app/cmap_alloc/sun-src/cmap_alloc.c	Wed Aug 19 17:35:59 2015 -0700
@@ -205,7 +205,7 @@
 			32, PropModeAppend, (unsigned char *)(&new_cmap),
 			10);
 	if (verbose) 
-	  (void)printf("done\n    new colormap id = 0x%x\n", new_cmap.colormap);
+	  (void)printf("done\n    new colormap id = 0x%lx\n", new_cmap.colormap);
     }
 }
 
--- a/open-src/app/fbconsole/sun-src/fbconsole.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/app/fbconsole/sun-src/fbconsole.c	Wed Aug 19 17:35:59 2015 -0700
@@ -260,7 +260,7 @@
 		    "fbconsole: couldn't open console log file '%s'\n",path);
 		exit(1);
 	}
-	setbuf(log, NULL);
+	setvbuf(log, NULL, _IONBF, 0);
 
 	fchmod(fileno(log), S_IRUSR|S_IWUSR);
 
--- a/open-src/app/gfx-utils/sun-src/fbconf_xorg/fbc/fbc_append_config.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/app/gfx-utils/sun-src/fbconf_xorg/fbc/fbc_append_config.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -64,7 +64,6 @@
 	if (supplement_path == NULL) {
 		return (FBC_ERR_OPEN);
 	}
-	xf86conffree((char *)supplement_path);	/* Don't need this path */
 
 #if (0)	/* This may or may not be necessary */
 	/*
--- a/open-src/app/gfx-utils/sun-src/fbconf_xorg/fbc/fbc_predid.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/app/gfx-utils/sun-src/fbconf_xorg/fbc/fbc_predid.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -96,7 +96,7 @@
 			sprintf(&hex_buf[hex_cols*i], " %02X",
 				edid_data[byte_addr]);
 		}
-		printf("\t0x%02X: %s\n", line_addr, hex_buf);
+		printf("\t0x%02zX: %s\n", line_addr, hex_buf);
 		hex_buf[0] = '\0';
 	}
 
--- a/open-src/app/gfx-utils/sun-src/fbconfig/fbconfig.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/app/gfx-utils/sun-src/fbconfig/fbconfig.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -1593,7 +1593,7 @@
 	 *      * The fbconfig(1M) arguments       (argc-1 pointers)
 	 *      * A NULL terminator                (     1 pointer )
 	 */
-	cfg_argv = malloc((2 + argc + 1) * sizeof (char *));
+	cfg_argv = calloc((2 + argc + 1), sizeof (char *));
 	if (cfg_argv == NULL) {
 		PrintError("Insufficient memory for new argument vector");
 		return (1);
--- a/open-src/app/gfx-utils/sun-src/gfx_common/vts/gfx_vts.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/app/gfx-utils/sun-src/gfx_common/vts/gfx_vts.c	Wed Aug 19 17:35:59 2015 -0700
@@ -155,7 +155,7 @@
  *    encountered, whereas the array size allows for multiple messages.
  */
 
-int
+void
 gfx_vts_set_message(
 	return_packet	*rp,		/* VTS test return packet */
 	int		count,
--- a/open-src/app/gfx-utils/sun-src/gfx_common/vts/include/gfx_vts.h	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/app/gfx-utils/sun-src/gfx_common/vts/include/gfx_vts.h	Wed Aug 19 17:35:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -53,7 +53,7 @@
 	const char	*format,	/* printf()-style format string */
 			...);		/* printf()-style variable arguments */
 
-int gfx_vts_set_message(
+void gfx_vts_set_message(
 	return_packet	*rp,		/* VTS test return packet */
 	int		count,
 	int		mesg_num,
--- a/open-src/app/gfx-utils/sun-src/vts/ast/tools.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/app/gfx-utils/sun-src/vts/ast/tools.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -169,19 +169,19 @@
 ast_map_mmio(
     void)
 {
-	register void *ptr;
+	if (ast_info.ast_mmio_ptr == NULL) {
+		register void *ptr;
 
-	if (ast_info.ast_mmio_ptr == NULL) {
 		ptr = mmap(NULL, ast_info.ast_mmio_size,
 		    PROT_READ | PROT_WRITE, MAP_SHARED,
 		    ast_info.ast_fd, ast_info.ast_mmio_addr);
 
 		if (ptr == MAP_FAILED)
 			return (-1);
+
+		ast_info.ast_mmio_ptr = (uchar_t *)ptr;
 	}
 
-	ast_info.ast_mmio_ptr = (uchar_t *)ptr;
-
 	if (gfx_vts_debug_mask & VTS_DEBUG)
 		printf("ast_mmio_ptr = 0x%llx\n",
 		    (unsigned long long)ast_info.ast_mmio_ptr);
@@ -194,9 +194,9 @@
 ast_map_fb(
     void)
 {
-	register void *ptr;
+	if (ast_info.ast_fb_ptr == NULL) {
+		register void *ptr;
 
-	if (ast_info.ast_fb_ptr == NULL) {
 		ptr = mmap(NULL, ast_info.ast_fb_size,
 		    PROT_READ | PROT_WRITE, MAP_SHARED,
 		    ast_info.ast_fd, ast_info.ast_fb_addr);
--- a/open-src/app/gfx-utils/sun-src/vts/mga/tools.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/app/gfx-utils/sun-src/vts/mga/tools.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -102,9 +102,9 @@
 mga_map_fb(
     void)
 {
-	register void *ptr;
+	if (mga_info.mga_fb_ptr == NULL) {
+		register void *ptr;
 
-	if (mga_info.mga_fb_ptr == NULL) {
 		ptr = mmap(NULL, mga_info.mga_fb_size,
 		    PROT_READ | PROT_WRITE, MAP_SHARED,
 		    mga_info.mga_fd, mga_info.mga_fb_addr);
@@ -126,19 +126,19 @@
 mga_map_control(
     void)
 {
-	register void *ptr;
+	if (mga_info.mga_control_ptr == NULL) {
+		register void *ptr;
 
-	if (mga_info.mga_control_ptr == NULL) {
 		ptr = mmap(NULL, mga_info.mga_control_size,
 		    PROT_READ | PROT_WRITE, MAP_SHARED,
 		    mga_info.mga_fd, mga_info.mga_control_addr);
 
 		if (ptr == MAP_FAILED)
 			return (-1);
+
+		mga_info.mga_control_ptr = (mga_t volatile *) ptr;
 	}
 
-	mga_info.mga_control_ptr = (mga_t volatile *) ptr;
-
 	if (gfx_vts_debug_mask & VTS_DEBUG)
 		printf("mga_control_ptr = 0x%llx\n",
 		    (unsigned long long) mga_info.mga_control_ptr);
@@ -150,19 +150,19 @@
 mga_map_iload(
     void)
 {
-	register void *ptr;
+	if (mga_info.mga_iload_ptr == NULL) {
+		register void *ptr;
 
-	if (mga_info.mga_iload_ptr == NULL) {
 		ptr = mmap(NULL, mga_info.mga_iload_size,
 		    PROT_READ | PROT_WRITE, MAP_SHARED,
 		    mga_info.mga_fd, mga_info.mga_iload_addr);
 
 		if (ptr == MAP_FAILED)
 			return (-1);
+
+		mga_info.mga_iload_ptr = (char volatile *) ptr;
 	}
 
-	mga_info.mga_iload_ptr = (char volatile *) ptr;
-
 	if (gfx_vts_debug_mask & VTS_DEBUG)
 		printf("mga_iload_ptr = 0x%llx\n",
 		    (unsigned long long) mga_info.mga_iload_ptr);
--- a/open-src/app/installalias/sun-src/installalias.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/app/installalias/sun-src/installalias.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1993, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1993, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -153,7 +153,8 @@
 	    return EBadFontPath;
 	}
 	dir->dir_mtime = statb.st_mtime;
-	while ((count = fscanf(file, "%1024s %[^\n]\n", file_name, font_name)) 
+	while ((count =
+		fscanf(file, "%1023s %1023[^\n]\n", file_name, font_name))
 	       != EOF) {
 	    if (count != 2) {
 		FontFileFreeDir (dir);
--- a/open-src/app/xhost/xhost.patch	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/app/xhost/xhost.patch	Wed Aug 19 17:35:59 2015 -0700
@@ -1,5 +1,5 @@
 diff --git a/xhost.c b/xhost.c
-index a67d136..f43b267 100644
+index a67d136..0e867b0 100644
 --- a/xhost.c
 +++ b/xhost.c
 @@ -119,6 +119,11 @@ extern int getdomainname(char *name, size_t len);
@@ -136,71 +136,66 @@
  	exit (1);
      }
      for (i = 0; i < namelen; i++) {
-@@ -325,8 +355,8 @@ change_host(Display *dpy, char *name, Bool add)
+@@ -325,7 +355,8 @@ change_host(Display *dpy, char *name, Bool add)
  	family = FamilyInternet;
  	name += 5;
  #else
 -	fprintf (stderr, "%s: not compiled for TCP/IP\n", ProgramName);
--	free(lname);
 +	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
 +	fprintf (stderr, gettext("%s: not compiled for TCP/IP\n"), ProgramName);
+ 	free(lname);
  	return 0;
  #endif
-     }
-@@ -335,8 +365,8 @@ change_host(Display *dpy, char *name, Bool add)
+@@ -335,7 +366,8 @@ change_host(Display *dpy, char *name, Bool add)
  	family = FamilyInternet6;
  	name += 6;
  #else
 -	fprintf (stderr, "%s: not compiled for IPv6\n", ProgramName);
--	free(lname);
 +	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
 +	fprintf (stderr, gettext("%s: not compiled for IPv6\n"), ProgramName);
+ 	free(lname);
  	return 0;
  #endif
-     }
-@@ -347,15 +377,15 @@ change_host(Display *dpy, char *name, Bool add)
+@@ -347,14 +379,16 @@ change_host(Display *dpy, char *name, Bool add)
  	family = FamilyInternet6;
  	name += 7;
  #else
 -	fprintf (stderr, "%s: not compiled for IPv6\n", ProgramName);
--	free(lname);
 +	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
 +	fprintf (stderr, gettext("%s: not compiled for IPv6\n"), ProgramName);
+ 	free(lname);
  	return 0;
  #endif
      }
  #endif /* ACCEPT_INETV6 */
      else if (!strncmp("dnet:", lname, 5)) {
 -	fprintf (stderr, "%s: not compiled for DECnet\n", ProgramName);
--	free(lname);
 +	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
 +	fprintf (stderr, gettext("%s: not compiled for DECnet\n"), ProgramName);
+ 	free(lname);
  	return 0;
      }
-     else if (!strncmp("nis:", lname, 4)) {
-@@ -363,8 +393,8 @@ change_host(Display *dpy, char *name, Bool add)
+@@ -363,7 +397,8 @@ change_host(Display *dpy, char *name, Bool add)
  	family = FamilyNetname;
  	name += 4;
  #else
 -	fprintf (stderr, "%s: not compiled for Secure RPC\n", ProgramName);
--	free(lname);
 +	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
 +	fprintf (stderr, gettext("%s: not compiled for Secure RPC\n"), ProgramName);
+ 	free(lname);
  	return 0;
  #endif
-     }
-@@ -373,8 +403,8 @@ change_host(Display *dpy, char *name, Bool add)
+@@ -373,7 +408,8 @@ change_host(Display *dpy, char *name, Bool add)
  	family = FamilyKrb5Principal;
  	name +=4;
  #else
 -	fprintf (stderr, "%s: not compiled for Kerberos 5\n", ProgramName);
--	free(lname);
 +	/* Internationalize messages for bug 4256527... S Swales 5/25/00 */
 +	fprintf (stderr, gettext("%s: not compiled for Kerberos 5\n"), ProgramName);
+ 	free(lname);
  	return 0;
  #endif
-     }
-@@ -386,11 +416,21 @@ change_host(Display *dpy, char *name, Bool add)
+@@ -386,11 +422,22 @@ change_host(Display *dpy, char *name, Bool add)
  	name += 3;
      }
      if (family == FamilyWild && (cp = strchr(lname, ':'))) {
@@ -222,12 +217,13 @@
 +	    /* Internationalize messages for bug 4256527... S Swales 5/25/00 */
 +	    fprintf (stderr, gettext("%s: unknown address family \"%s\"\n"),
 +		     ProgramName, lname);
++	    free(lname);
 +	    return 0;
 +	}
      }
      free(lname);
  
-@@ -400,8 +440,8 @@ change_host(Display *dpy, char *name, Bool add)
+@@ -400,8 +447,8 @@ change_host(Display *dpy, char *name, Bool add)
  
  	cp = strchr(name, ':');
  	if (cp == NULL || cp == name) {
@@ -238,7 +234,7 @@
  	      ProgramName, name);
  	    return 0;
  	}
-@@ -429,7 +469,8 @@ change_host(Display *dpy, char *name, Bool add)
+@@ -429,7 +476,8 @@ change_host(Display *dpy, char *name, Bool add)
  	retval = krb5_parse_name(name, &princ);
  	if (retval) {
  	    krb5_init_ets();	/* init krb errs for error_message() */
@@ -248,7 +244,7 @@
  		    ProgramName, error_message(retval));
  	    return 0;
  	}
-@@ -456,7 +497,7 @@ change_host(Display *dpy, char *name, Bool add)
+@@ -456,7 +504,7 @@ change_host(Display *dpy, char *name, Bool add)
  	    XAddHost(dpy, &ha);
  	else
  	    XRemoveHost(dpy, &ha);
@@ -257,7 +253,7 @@
  	return 1;
      }
      /*
-@@ -475,12 +516,14 @@ change_host(Display *dpy, char *name, Bool add)
+@@ -475,12 +523,14 @@ change_host(Display *dpy, char *name, Bool add)
  	    *cp = '\0';
  	    pwd = getpwnam(name);
  	    if (!pwd) {
@@ -274,7 +270,7 @@
  		return 0;
  	    }
  	    netname = username;
-@@ -587,8 +630,11 @@ change_host(Display *dpy, char *name, Bool add)
+@@ -587,8 +637,11 @@ change_host(Display *dpy, char *name, Bool add)
  		familyMsg = "inet ";
  	    }
  
@@ -288,7 +284,7 @@
  	}
  	freeaddrinfo(addresses);
  	return 1;
-@@ -824,14 +870,16 @@ static int
+@@ -824,14 +877,16 @@ static int
  local_xerror(Display *dpy, XErrorEvent *rep)
  {
      if ((rep->error_code == BadAccess) && (rep->request_code == X_ChangeHosts)) {
--- a/open-src/common/Makefile.init	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/common/Makefile.init	Wed Aug 19 17:35:59 2015 -0700
@@ -178,6 +178,8 @@
 PARFAIT_ENV_gcc		= PARFAIT_NATIVEGCC="$(GCC)"
 PARFAIT_ENV_gcc	       += PARFAIT_NATIVEGXX="$(GXX)"
 PARFAIT_ENV		= $(PARFAIT_ENV_$(MODULE_COMPILER))
+# Output shorter error messages when parfait-wrapped compilers fail
+PARFAIT_ENV            += PARFAIT_WRAPPER_QUIETNATIVE=1
 
 ## Set common variables based on above rules
 CC			= $(CC_$(CHOSEN_COMPILER))
--- a/open-src/common/X-parfait.conf	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/common/X-parfait.conf	Wed Aug 19 17:35:59 2015 -0700
@@ -5,7 +5,7 @@
  */
 
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -29,26 +29,6 @@
 
 include 'std.conf';
 
-/* Local copy until added to parfait's std.conf (Bug 14121100) */
-asprintf(p,const fmt,args...) : printf(fmt,args), noescape {
-    if (result >= 0) {
-        *p == new(result);
-    }
-}
-vasprintf(p,const fmt,va) : noescape {
-    if (result >= 0) {
-        *p == new(result);
-    }
-}
-
-/* Local copy until added to parfait's std.conf (Bug 14121213) */
-strndup(const s, n) : noescape {
-    if ( result != 0 ) {
-        result == new(undefined);
-        strlen(result) == PRE ( strlen(s) < n ? strlen(s) : n);
-    }
-}
-
 /* Define custom bug types for common precondition assertions */
 bugtype "null-pointer-deref-call-X"(ptr) : "null-pointer-deref" {
    name="Null Pointer Dereference in X function";
@@ -56,6 +36,19 @@
    enabled="true";
    message="Null pointer dereference in call to ", callee_name(), ". Pointer ", name(ptr), " may be dereferenced";
 }
+bugtype "unchecked-result-call-X"(val) : "unchecked-result" {
+   name="Unchecked result";
+   priority="error";
+   enabled="true";
+   message="Unchecked return value from call to ", callee_name(), ". Value " , name(val), " must be checked to ensure this function was successful.";
+}
+bugtype "pointer-size-mismatch-kernel"(ptr,size) {
+   name="Pointer size mismatch in kernel function";
+   priority="error";
+   enabled="true";
+   message="Incorrect pointer size in call to ", callee_name(), ". Pointer ", name(ptr), " given as size ", size;
+}
+
 
 /*************************************************************************
  * Client side functions
@@ -83,6 +76,8 @@
     "null-pointer-deref-call-X"(display) : display != 0;
     if (result != 0) {
         result == new(undefined);
+        may_write(result);
+        escape(data);
     }
 }
 XDestroyImage(p) { /* actually in <X11/Xutil.h> */
@@ -91,25 +86,30 @@
 }
 /* Todo: XInitImage, XGetImage, XGetSubImage */
 
-XOpenDisplay(const d) {
+XOpenDisplay(const d) : noescape {
+    "unchecked-result-call-X"(result): is_checked(result);
     if (result != 0) {
-        result == new(undefined);
+        result == new(size(*result));
+        may_write(result);
     }
 }
 
-XFetchBuffer(d, n, b) {
+XFetchBuffer(d, n, b) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
+    "null-pointer-deref-call-X"(n) : n != 0;
     if (result != 0) {
         *n == size(result);
         result == new(*n);
+        may_write(result);
     }
 }
 XFetchBytes(d, n) : XFetchBuffer(d, n, 0);
 
-XGetAtomName(d, a) {
+XGetAtomName(d, a) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
     if (result != 0) {
         result == new(undefined);
+        may_write(result);
     }
 }
 /* Todo: XGetAtomNames, XGetDefault, XDisplayName, XKeysymToString,
@@ -140,34 +140,43 @@
     result != 0;
     init<x-resource>(result);
 }
-XLoadFont(d, c) : noescape {
+XLoadFont(d, const c) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
     result != 0;
     init<x-resource>(result);
 }
 
-XCreateGC(d, dr, vm, v) : noescape {
+XCreateGC(d, dr, const vm, v) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
     if (result != 0) {
         result == new(112); /* sizeof(struct _XGC) */
+        may_write(result);
+    } else {
+        @errno != 0;
     }
 }
 /* Todo: XGContextFromGC, XFlushGC */
 
-XCreatePixmap(d, dr, w, h, dp) {
+XCreatePixmap(d, dr, w, h, dp) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
     result != 0;
     init<x-resource>(result);
 }
-XCreateBitmapFromData(d, dr, dt, w, h) {
+XCreateBitmapFromData(d, dr, dt, w, h) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
-    result != 0;
-    init<x-resource>(result);
+    if (result != 0) {
+        init<x-resource>(result);
+    } else {
+        @errno != 0;
+    }
 }
-XCreatePixmapFromBitmapData(d, dr, dt, w, h, fg, bg, dp) {
+XCreatePixmapFromBitmapData(d, dr, dt, w, h, fg, bg, dp) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
-    result != 0;
-    init<x-resource>(result);
+    if (result != 0) {
+        init<x-resource>(result);
+    } else {
+        @errno != 0;
+    }
 }
 XCreateSimpleWindow(d,p,x,y,w,h,bw,b,bg) {
     "null-pointer-deref-call-X"(d) : d != 0;
@@ -175,7 +184,7 @@
     init<x-resource>(result);
 }
 /* Todo: XGetSelectionOwner */
-XCreateWindow(d,p,x,y,w,h,bw,dp,c,v,vm,a) {
+XCreateWindow(d,p,x,y,w,h,bw,dp,c,v,const vm,a) {
     "null-pointer-deref-call-X"(d) : d != 0;
     result != 0;
     init<x-resource>(result);
@@ -184,44 +193,57 @@
 
 XListExtensions(d, n) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
+    "null-pointer-deref-call-X"(n) : n != 0;
     if (result != 0) {
         result == new(undefined); /* n * char* + extension strings */
+        may_write(n);
+        may_write(result);
     }
 }
 XListProperties(d, w, n) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
     if (result != 0) {
-        result == new(n * 4); 
+        result == new(n * 4);
+        may_write(n);
+        may_write(result);
     }
 }
-XListHosts(d, n, s) : noescape {
+XListHosts(d, n, enabled) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
     if (result != 0) {
-        result == new(undefined); /* n * char* + extension strings */
+        result == new(undefined); /* n * char* + host strings */
+        may_write(n);
+        may_write(enabled);
+        may_write(result);
     }
 }
 
 XKeycodeToKeysym(d, k, i) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
 }
-XLookupKeysym(e, i) : noescape {
+XLookupKeysym(e, const i) : noescape {
     "null-pointer-deref-call-X"(e) : e != 0;
-}   
+}
 XGetKeyboardMapping(d, fk, kc, ks) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
+    "null-pointer-deref-call-X"(ks) : ks != 0;
     if (result != 0) {
         result == new(kc * ks);
+        may_write(ks);
+        may_write(result);
     }
 }
-XStringToKeysym(s) : noescape {
+XStringToKeysym(const s) : noescape {
     "null-pointer-deref-call-X"(s) : s != 0;
 }
-XMaxRequestSize(d) : noescape {
+XMaxRequestSize(const d) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
 }
-XExtendedMaxRequestSize(d) : XMaxRequestSize(d);
-XScreenResourceString(d) : XMaxRequestSize(d);
-XDisplayMotionBufferSize(d) : XMaxRequestSize(d);
+XExtendedMaxRequestSize(const d) : XMaxRequestSize(d);
+XScreenResourceString(const s) : noescape {
+    "null-pointer-deref-call-X"(s) : s != 0;
+}
+XDisplayMotionBufferSize(const d) : XMaxRequestSize(d);
 XVisualIdFromVisual(v) : noescape {
     /* Todo: visual resource id? */
     "null-pointer-deref-call-X"(v) : v != 0;
@@ -233,44 +255,46 @@
 XAddExtension(d) {
     "null-pointer-deref-call-X"(d) : d != 0;
     if (result != 0) {
-        result == new(128);
+        result == new(size(*result));
+        may_write(result);
+        escape(result);
     }
 }
-XInitExtension(d, n) : XAddExtension(d);
+XInitExtension(d, const n) : XAddExtension(d);
 XFindOnExtensionList(s, n) {
     "null-pointer-deref-call-X"(s) : s != 0;
 }
 
 /* these are routines for which there are also macros */
-XDefaultRootWindow(d) : noescape {
+XDefaultRootWindow(const d) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
 }
-XRootWindow(d, n) : XDefaultRootWindow(d);
-XRootWindowOfScreen(s) : XDefaultRootWindow(s);
-XDefaultVisual(d, n) : XDefaultRootWindow(d);
-XDefaultVisualOfScreen(s) : XDefaultRootWindow(s);
-XDefaultGC(d, n) : XDefaultRootWindow(d);
-XDefaultGCOfScreen(s) : XDefaultRootWindow(s);
-XBlackPixel(d, n) : XDefaultRootWindow(d);
-XWhitePixel(d, n) : XDefaultRootWindow(d);
-XBlackPixelOfScreen(s) : XDefaultRootWindow(s);
-XWhitePixelOfScreen(s) : XDefaultRootWindow(s);
-XNextRequest(d) : XDefaultRootWindow(d);
-XLastKnownRequestProcessed(d) : XDefaultRootWindow(d);
-XServerVendor(d) : XDefaultRootWindow(d);
-XDisplayString(d) : XDefaultRootWindow(d);
+XRootWindow(const d, const n) : XDefaultRootWindow(d);
+XRootWindowOfScreen(const s) : XDefaultRootWindow(s);
+XDefaultVisual(const d, const n) : XDefaultRootWindow(d);
+XDefaultVisualOfScreen(const s) : XDefaultRootWindow(s);
+XDefaultGC(const d, const n) : XDefaultRootWindow(d);
+XDefaultGCOfScreen(const s) : XDefaultRootWindow(s);
+XBlackPixel(const d, const n) : XDefaultRootWindow(d);
+XWhitePixel(const d, const n) : XDefaultRootWindow(d);
+XBlackPixelOfScreen(const s) : XDefaultRootWindow(s);
+XWhitePixelOfScreen(const s) : XDefaultRootWindow(s);
+XNextRequest(const d) : XDefaultRootWindow(d);
+XLastKnownRequestProcessed(const d) : XDefaultRootWindow(d);
+XServerVendor(const d) : XDefaultRootWindow(d);
+XDisplayString(const d) : XDefaultRootWindow(d);
 
-XDefaultColormap(d, n) : noescape {
+XDefaultColormap(const d, const n) : noescape {
     /* Todo: colormap resource id? */
     "null-pointer-deref-call-X"(d) : d != 0;
 }
-XDefaultColormapOfScreen(s) : XDefaultColormap(s, 0);
+XDefaultColormapOfScreen(const s) : XDefaultColormap(s, 0);
 
-XDisplayOfScreen(s) : XDefaultRootWindow(s);
-XScreenOfDisplay(d, n) : XDefaultRootWindow(d);
-XDefaultScreenOfDisplay(d) : XDefaultRootWindow(d);
-XEventMaskOfScreen(s) : XDefaultRootWindow(s);
-XScreenNumberOfScreen(s) : XDefaultRootWindow(s);
+XDisplayOfScreen(const s) : XDefaultRootWindow(s);
+XScreenOfDisplay(const d, const n) : XDefaultRootWindow(d);
+XDefaultScreenOfDisplay(const d) : XDefaultRootWindow(d);
+XEventMaskOfScreen(const s) : XDefaultRootWindow(s);
+XScreenNumberOfScreen(const s) : XDefaultRootWindow(s);
 
 /* Todo: XSetErrorHandler, XSetIOErrorHandler */
 
@@ -279,14 +303,22 @@
     "null-pointer-deref-call-X"(c) : c != 0;
     if (result != 0) {
         result == new(c * 12);  /* sizeof(XPixmapFormatValues) */
-    }    
+        may_write(c);
+        may_write(result);
+    } else {
+        @errno != 0;
+    }
 }
 XListDepths(d, s, c) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
     "null-pointer-deref-call-X"(c) : c != 0;
     if (result != 0) {
         result == new(c * 4);  /* sizeof(int) */
-    }    
+        may_write(c);
+        may_write(result);
+    } else {
+        @errno != 0;
+    }
 }
 /* Todo: ICCCM routines - XReconfigureWMWindow...XSetWMColormapWindows,
    XSetTransientForHint */
@@ -295,11 +327,11 @@
 XActivateScreenSaver(d) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
 }
-XAddHost(d, h) : noescape {
+XAddHost(d, const h) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
     "null-pointer-deref-call-X"(h) : h != 0;
 }
-XAddHosts(d, h, n) : noescape {
+XAddHosts(d, const h, const n) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
     "null-pointer-deref-call-X"(h) : h != 0;
 }
@@ -317,14 +349,20 @@
 /* Todo: XDoesBackingStore...XDisplayHeightMM */
 XDisplayKeycodes(d, min, max) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
+    may_write(min);
+    may_write(max);
     min >= 8;
     max <= 255;
 }
 /* Todo: XDisplayPlanes...XEventsQueued */
 XFetchName(d, w, name) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
+    may_write(name);
+    (result == 0) => (name == 0);
     if (name != 0) {
-       name == new(undefined);
+        name == new(undefined);
+        may_write(result);
+        result == 1;
     }
 }
 /* Todo: XFillArcs...XForceScreenSaver */
@@ -343,12 +381,17 @@
     "null-pointer-deref-call-X"(d) : d != 0;
     destroy<x-resource>(f);
 }
-/* Todo: XFreeFontInfo */
+XFreeFontInfo(names, info, count) : noescape {
+    /* Todo: free contents of names & info */
+    (names != 0) => delete(names);
+    (info != 0) => delete(info);
+}
 XFreeFontNames(l) : free(l);
 XFreeFontPath(l) : free(l);
 XFreeGC(d, gc) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
     destroy<x-resource>(gc);
+    delete(gc);
 }
 XFreeModifierMap(m) : free(m);
 XFreePixmap(d, p) : noescape {
@@ -360,13 +403,28 @@
 /* Todo: XGetInputFocus...XGetTransientForHint */
 XGetWindowProperty(d, w, p, lo, ll, del, rt, at, af, n, bar, prop) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
+    "unchecked-result-call-X"(result): is_checked(result);
+    result == 0 => prop != 0;
+    prop == 0 => result != 0;
+    if (result == 0) {
+        may_write(at);
+        may_write(af);
+        may_write(n);
+        may_write(bar);
+        may_write(prop);
+    }
     if (prop != 0) {
-       prop == new(undefined);
+        prop == new(undefined);
+        may_write(prop);
+        result == 0;
     }
 }
 /* Todo: XGetWindowAttributes...XQueryColors */
-XQueryExtension(d, n, op, ev, er) : noescape {
+XQueryExtension(d, const n, op, ev, er) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
+    may_write(op);
+    may_write(ev);
+    may_write(er);
     if (result != 0) {
        op >= 128;
        op <= 255;
@@ -376,28 +434,34 @@
 XQueryTree(d, w, r, p, c, nc) : noescape {
     "null-pointer-deref-call-X"(d) : d != 0;
     "null-pointer-deref-call-X"(c) : c != 0;
+    may_write(r);
+    may_write(p);
+    may_write(c);
+    may_write(nc);
     if (result != 0) {
-       c == new(nc * 4);
+        c == new(nc * size(w));
     }
 }
 /* Todo: XRaiseWindow...XRemoveFromSaveSet */
-XRemoveHost(d, h) : XAddHost(d, h);
-XRemoveHosts(d, h, n) : XAddHosts(d, h, n);
+XRemoveHost(d, const h) : XAddHost(d, h);
+XRemoveHosts(d, const h, const n) : XAddHosts(d, h, n);
 /* Todo: XReparentWindow...XFreeEventData */
 
 /* Allocation functions from <X11/Xutil.h> */
-XAllocClassHint() : malloc(size(result));
-XAllocIconSize() : malloc(size(result));
-XAllocSizeHints() : malloc(size(result));
-XAllocStandardColormap() : malloc(size(result));
-XAllocWMHints() : malloc(size(result));
+XAllocClassHint() : calloc(1, size(*result));
+XAllocIconSize() : calloc(1, size(*result));
+XAllocSizeHints() : calloc(1, size(*result));
+XAllocStandardColormap() : calloc(1, size(*result));
+XAllocWMHints() : calloc(1, size(*result));
 
 /** libXt
  * Functions from Xt's Alloc.c - like libc ones, except exit on failure,
  * instead of return NULL
  */
 XtAsprintf(p,const fmt,args...) : printf(fmt,args), noescape {
-    *p == new(result);
+    *p == new(result + 1);
+    strlen(*p) == result;
+    may_write(*p);
 }
 
 XtMalloc(s) {
@@ -407,14 +471,22 @@
 XtRealloc(p,s) {
     delete(p);
     result == new(s);
+    result[0..(size(PRE p) < s ? size(PRE p) : s)] == PRE p[0..(size(PRE p) < s ? size(PRE p) : s)];
 }
 
 XtCalloc(n,s) {
     result == new(n*s);
+    result[0 .. (n * s)] == bytes(0, (n * s));
 }
 
 XtFree(p) : free(p);
 
+/* libXcursor private function */
+XcursorScanTheme(theme, name) : noescape {
+   (theme == 0 || name == 0) => result == 0;
+   (result != 0 && result != 1) => init<file-ptr>(result);
+}
+
 /*************************************************************************
  * Server side functions
  */
@@ -441,29 +513,12 @@
     "wrong-size-swap"(x,2): size(x) == 4;
 }
 
-/* dix/pixmap.c */
-AllocatePixmap(const pScreen, pixDataSize) : noescape {
-    if (result != 0) {
-        result == new(pixDataSize);
-    }
-}
-FreePixmap(p) : free(p);
-
-/* dix/region.c */
-RegionCreate(const rect, s) {
-    result == new(12); /* sizeof struct pixman_region16 */
+/* dix/atom.c */
+MakeAtom(string, len, makeit) : noescape {
+    "null-pointer-deref-call-X"(string): string != 0;
+    "buffer-overflow-call-stdc-str"(string): len <= strlen(string);
 }
-RegionDestroy(p) : free(p);
 
-/* fb/fbpixmap.c */
-fbCreatePixmapBpp(const pS, w, h, d, b, ht) {
-    if (result != 0) {
-        result == new(w*h);
-    }
-}
-fbCreatePixmap(const pS, w, h, d, ht) : fbCreatePixmapBpp(pS, w, h, d, d, ht);
-fbDestroyPixmap(p) : FreePixmap(p);
-                 
 /* os/log.c: logging functions */
 LogWrite(verb, const fmt, args...) : printf(fmt, args), noescape;
 LogMessageVerb(type, verb, const fmt, args...) : printf(fmt, args), noescape;
@@ -478,7 +533,10 @@
     result == new(s);
 }
 Xcalloc(s) : calloc(1,s);
-XNFcalloc(s) : XNFalloc(s);
+XNFcalloc(s) {
+    result == new(s);
+    result[0 .. s] == bytes(0, s);
+}
 Xrealloc(p, s) : realloc(p, s);
 XNFrealloc(p, s) : realloc(p, s);
 Xfree(p) : free(p);
@@ -486,9 +544,10 @@
     if ( s == 0 ) {
         result == 0;
     } else {
-        if( result != 0 ) {
+        if ( result != 0 ) {
             result == new(strlen(s)+1);
             strlen(result) == strlen(s);
+            result[0..strlen(result)] == PRE s[0..strlen(s)];
         }
     }
 }
@@ -503,29 +562,55 @@
 OsAbort() : abort();
 Fopen(f, m) : fopen(f, m);
 Fclose(p) : fclose(p);
-          
+
 /* os/xprintf.c: allocating printf wrappers/variants */
 Xvasprintf(p, fmt, va) : vasprintf(p, fmt, va);
 Xasprintf(p, fmt, args...) : asprintf(p, fmt, args);
 XNFvasprintf(p, fmt, va) : noescape {
     *p == new(result);
+    may_write(*p);
 }
 XNFasprintf(p, fmt, args...) : noescape, printf(fmt, args) {
     *p == new(result);
+    may_write(*p);
 }
 Xvprintf(fmt, va) : noescape {
     if (result != 0) {
         result == new(undefined);
+        may_write(result);
     }
 }
 Xprintf(fmt, args...) : noescape, printf(fmt, args) {
     if (result != 0) {
         result == new(undefined);
+        may_write(result);
     }
 }
 XNFvprintf(fmt, va) : noescape {
     result == new(undefined);
+    may_write(result);
 }
 XNFprintf(fmt, args...) : noescape, printf(fmt, args) {
     result == new(undefined);
+    may_write(result);
 }
+
+/*************************************************************************
+ * Kernel modules
+ */
+
+@if (file=="kernel/*") {
+
+    include 'onnv.conf';
+
+    /* graphics driver porting layer: open-src/kernel/drm/src/drm_memory.c */
+    drm_alloc(s, a) : calloc(1, s);
+    drm_calloc(n, s, a) : calloc(n, s);
+    drm_realloc(pp, ps, s, a) : realloc(pp, s) {
+        "pointer-size-mismatch-kernel"(pp,ps) : ps == size(pp);
+    }
+    drm_free(p, s, a) {  /* unlike kmem_free, accepts/ignores NULL pointers */
+        "pointer-size-mismatch-kernel"(p,s) : s == size(p);
+        delete(p);
+    }
+}
--- a/open-src/lib/libX11/im-suneu-greek.patch	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/lib/libX11/im-suneu-greek.patch	Wed Aug 19 17:35:59 2015 -0700
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -22,10 +22,16 @@
 #
 
 diff --git a/src/imConv.c b/src/imConv.c
-index ec8493f..93e683f 100644
+index ec8493f..cfd75e7 100644
 --- a/src/imConv.c
 +++ b/src/imConv.c
-@@ -69,6 +69,7 @@ struct SubstRec {
+@@ -64,11 +64,12 @@ typedef int (*ucstocsConvProc)(
+ );
+ 
+ struct SubstRec {
+-    const char encoding_name[8];
++    const char encoding_name[12]; /* large enough to fit "suneu-greek" */
+     const char charset_name[12];
  };
  
  static const struct SubstRec SubstTable[] = {
--- a/open-src/lib/libX11/sun-src/modules/lc/gb18030/lcGB18030.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/lib/libX11/sun-src/modules/lc/gb18030/lcGB18030.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright © 1996, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright © 1996, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -792,28 +792,28 @@
     XPointer *args,
     int num_args)
 {
-    XPointer	outbufptr, outbufptr_save;
+    XPointer	outbufptr, outbufptr_end;
     int		to_left_save = *to_left;
     wchar_t 	*pwc = (wchar_t *) *to;
     int		rtn, rtn_1;
 
 
     outbufptr = (XPointer) Xmalloc(*to_left * 4); /* 100 safty tolerence */
-    outbufptr_save = outbufptr;
+    outbufptr_end = outbufptr;
 
     rtn = gb18030_ctstombs(conv,
 	    from,
 	    from_left,
-	    &outbufptr,
+	    &outbufptr_end,
 	    to_left,
 	    args,
 	    num_args);
 
-    *outbufptr='\0';
+    *outbufptr_end = '\0';
 
-    rtn_1 = mbstowcs(pwc, outbufptr_save, (to_left_save - *to_left));
+    rtn_1 = mbstowcs(pwc, outbufptr, (to_left_save - *to_left));
 
-    Xfree(outbufptr_save);
+    Xfree(outbufptr);
 
     *to_left = to_left_save - rtn_1;
     *to = *to + rtn_1 * sizeof(wchar_t);
--- a/open-src/lib/libXext/sun-src/src/XPanoramiX.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/lib/libXext/sun-src/src/XPanoramiX.c	Wed Aug 19 17:35:59 2015 -0700
@@ -572,7 +572,7 @@
       if (!xiGetInfo)
          return 0;
 
-      if ((fb > -1) && (fb < fbs))  /* if fb has a legal value */
+      if ((fb >= 0) && (fb < fbs) && (fb < MAXSCREEN))  /* if fb has a legal value */
       {
          *xret = rects[fb].x + (rects[fb].width / 2);
          *yret = rects[fb].y + (rects[fb].height / 2);
--- a/open-src/lib/libXmu/Makefile	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/lib/libXmu/Makefile	Wed Aug 19 17:35:59 2015 -0700
@@ -104,6 +104,7 @@
 LIBXMUU_PKG_METADATA_DIR      = $(PROTOMETA)/x11-library-libxmuu
 LIBXMUU_PKG_ATTRDATA_FILE     = $(LIBXMUU_PKG_METADATA_DIR)/$(ATTRDATA_FILE_NAME)
 LIBXMUU_PKG_LICENSE_FILE      = $(LIBXMUU_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME)
+$(LIBXMUU_PKG_LICENSE_FILE)  := MODULE_DESC = $(MODTYPE_DESC:Xmu=Xmuu)
 LIBXMUU_METADATA_TARGETS = \
 	$(LIBXMUU_PKG_METADATA_DIR) \
 	$(LIBXMUU_PKG_ATTRDATA_FILE) \
--- a/open-src/lib/libXp/6724993.patch	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/lib/libXp/6724993.patch	Wed Aug 19 17:35:59 2015 -0700
@@ -1,5 +1,7 @@
---- src/Makefile.am	2008-08-26 09:58:57.225299000 -0700
-+++ src/Makefile.am.new	2008-08-26 10:08:24.257125000 -0700
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 37671e4..6d34ad3 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
 @@ -17,6 +17,7 @@ libXp_la_SOURCES =			\
  	XpPrinter.c			\
  	XpPutData.c			\
@@ -8,8 +10,11 @@
  					\
  	XpExtUtil.h
  
---- src/XpDpi.c	1969-12-31 16:00:00.000000000 -0800
-+++ src/XpDpi.c.new	2008-08-26 13:44:31.473701000 -0700
+diff --git a/./tmp-regen/src/XpDpi.c b/src/XpDpi.c
+new file mode 100644
+index 0000000..cb9b909
+--- /dev/null
++++ b/src/XpDpi.c
 @@ -0,0 +1,101 @@
 +/* $XConsortium: XpDpi.c /main/4 1996/12/04 10:24:31 lehors $ */
 +/******************************************************************************
@@ -112,3 +117,15 @@
 +   return XpClientDPI(dpy, client_dpi);
 +}
 +#endif
+diff --git a/src/XpExtUtil.c b/src/XpExtUtil.c
+index 89f66c0..b5ef6b8 100644
+--- a/src/XpExtUtil.c
++++ b/src/XpExtUtil.c
+@@ -103,6 +103,7 @@ static XEXT_GENERATE_ERROR_STRING (XpError, xp_extension_name,
+  */
+ 
+ static XPrintLocalExtensionVersion xpprintversions[] = {{XP_ABSENT,0,0},
++	{XP_PRESENT, XP_PROTO_MAJOR, 0},
+ 	{XP_PRESENT, XP_PROTO_MAJOR, XP_PROTO_MINOR}};
+ 
+ 
--- a/open-src/lib/libXp/Makefile	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/lib/libXp/Makefile	Wed Aug 19 17:35:59 2015 -0700
@@ -37,7 +37,7 @@
 TARBALL_SHA256= 7f360c9905849c3587d48efc0f0ecbc852c19f61a52b18530d6b005cb9148c57
 
 # Patches to apply to source after unpacking, in order
-SOURCE_PATCHES = solaris-abi.patch 6724993.patch
+SOURCE_PATCHES = solaris-abi.patch 6724993.patch,-p1
 
 # Since we're patching src/Makefile.am in solaris-abi.patch,
 # we need to autoreconf
--- a/open-src/lib/libdga/sun-src/cmap_grab.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/lib/libdga/sun-src/cmap_grab.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,4 +1,4 @@
-/* Copyright (c) 1993, 1999, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 1993, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -276,6 +276,7 @@
     }
 
     if( read(infofd, &tmp, sizeof(tmp)) != sizeof(tmp) ) {
+	(void) close(infofd) ;
 	cleanup_lockpages(cmap_grab,0,0,0) ;
 #ifdef MT
 	mutex_unlock(&dgaGlobalMutex);
@@ -284,6 +285,7 @@
     }
 
     if( tmp.cm_magic != CMMAGIC ) {
+	(void) close(infofd) ;
 	cleanup_lockpages(cmap_grab,0,0,0) ;
 #ifdef MT
 	mutex_unlock(&dgaGlobalMutex);
--- a/open-src/lib/libdga/sun-src/dga_Xrequests.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/lib/libdga/sun-src/dga_Xrequests.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,4 +1,4 @@
-/* Copyright (c) 1993, 2001, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 1993, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -168,21 +168,6 @@
 /*			protminor = 0; let minor number pass through */
 			}
 		}
-	else if ((xecp = XInitExtension(dpy, "SunWindowGrabber")) != NULL) {
-		if (strcmp(ServerVendor(dpy),
-		    "X11/NeWS - Sun Microsystems Inc.") == 0) {
-			if (VendorRelease(dpy) >= 3000) {
-				protmajor = 2;
-				protminor = 0;
-				}
-			else if (VendorRelease(dpy) >= 2000) {
-				protmajor = 1;
-				protminor = 0;
-				}
-			}
-		else
-			return 0;
-		}
 	else
 		return 0;
 
@@ -1328,6 +1313,9 @@
     int       type = dga_draw_type(dgadraw);
     int       status;
 
+    if (dpy == NULL)
+	return BadDrawable;
+
 #ifdef MT
     mutex_lock(&dgaGlobalMutex);
 #endif
--- a/open-src/lib/libdga/sun-src/dga_internal.h	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/lib/libdga/sun-src/dga_internal.h	Wed Aug 19 17:35:59 2015 -0700
@@ -1,4 +1,4 @@
-/* Copyright (c) 1993, 1997, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 1993, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -61,8 +61,8 @@
 #else
 	int	    (*w_lock_func)();   /* alternate function for locking */
 #endif
-	int	    (*w_unlock_func)(); /* alternate func for unlocking */
-	int	    (*w_update_func)(); 
+	int	    (*w_unlock_func)(Dga_drawable); /* alternate func for unlocking */
+	int	    (*w_update_func)(Dga_drawable);
 	int	    w_modif;		/* cached result of update check */
 	u_int       c_wm_chngcnt[17];	/* last recorded global change counts */
 	u_int       *w_wm_2nd;          /* Ptr to second entry in wm_chngcnt[]*/
@@ -239,8 +239,8 @@
 #else
     int         (*p_lock_func)(); /* alternate function for locking */
 #endif
-    int         (*p_unlock_func)(); /* alternate func for unlocking */
-    int         (*p_update_func)(); /* function to call for updates */
+    int         (*p_unlock_func)(Dga_drawable); /* alternate func for unlocking */
+    int         (*p_update_func)(Dga_drawable, short); /* function to call for updates */
     int         p_modif;        /* cached result of update check ?? */
     u_int	c_chngcnt[1];   /* Last recorded global change count */
     u_int       *p_chngcnt_2nd;  /* Pts to c_chngcnt[0]*/
@@ -293,10 +293,6 @@
 
 typedef void * Dga_pixmap;
 
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
 #ifdef MT
 extern mutex_t		dgaGlobalMutex;
 extern mutex_t		dgaGlobalPixmapMutex;
--- a/open-src/lib/libdga/sun-src/draw_db.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/lib/libdga/sun-src/draw_db.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,4 +1,4 @@
-/* Copyright (c) 1993, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 1993, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -43,6 +43,7 @@
 	return (dga_db_grab((Dga_window)dgawin, nbuffers, vrtfunc, vrtcounterp));
     }
     case DGA_DRAW_PIXMAP:
+    default:
 	return (0);
     }
 }
@@ -59,6 +60,7 @@
 	return (dga_db_ungrab((Dga_window)dgawin));
     }
     case DGA_DRAW_PIXMAP:
+    default:
 	return (0);
     }
 }
@@ -167,6 +169,7 @@
 	return (dga_db_interval_check((Dga_window)dgawin));
     }
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps - consider interval always expired */
 	return (1);
     }
@@ -185,6 +188,7 @@
 	return (dga_db_write_inquire((Dga_window)dgawin));
     }
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps - always return an invalid buffer index */
 	return (-1);
     }
@@ -203,6 +207,7 @@
 	return (dga_db_read_inquire((Dga_window)dgawin));
     }
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps - always return an invalid buffer index */
 	return (-1);
     }
@@ -221,6 +226,7 @@
 	return (dga_db_display_inquire((Dga_window)dgawin));
     }
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps - always return an invalid buffer index */
 	return (-1);
     }
@@ -240,6 +246,7 @@
 	return (dga_db_display_done((Dga_window)dgawin, flag, display_done_func));
     }
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps - consider display done (to prevent hangs) */
 	return (1);
     }
@@ -258,6 +265,7 @@
 	return (dga_win_dbinfop((Dga_window)dgawin));
     }
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps - return NULL */
 	return (NULL);
     }
--- a/open-src/lib/libdga/sun-src/draw_inquiry.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/lib/libdga/sun-src/draw_inquiry.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,4 +1,4 @@
-/* Copyright (c) 1993, 1997, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 1993, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -42,6 +42,7 @@
     case DGA_DRAW_PIXMAP:
 	return (dgai_pix_display((_Dga_pixmap)dgadraw));
     }
+    return (NULL);
 }
 
 Drawable
@@ -53,6 +54,7 @@
     case DGA_DRAW_PIXMAP:
 	return ((Drawable)((_Dga_pixmap)dgadraw)->p_id);
     }
+    return (None);
 }
 
 int
@@ -66,6 +68,7 @@
     case DGA_DRAW_PIXMAP:
 	return (DGA_DRAW_PIXMAP);
     }
+    return (-1);
 }
 
 char *
@@ -77,6 +80,7 @@
     case DGA_DRAW_PIXMAP:
 	return (dgai_pix_devname((_Dga_pixmap)dgadraw));
     }
+    return (NULL);
 }
 
 int
@@ -88,6 +92,7 @@
     case DGA_DRAW_PIXMAP:
 	return (dgai_pix_devfd((_Dga_pixmap)dgadraw));
     }
+    return (-1);
 }
 
 int
@@ -99,6 +104,7 @@
     case DGA_DRAW_PIXMAP:
 	return (dgai_pix_depth((_Dga_pixmap)dgadraw));
     }
+    return (-1);
 }
 
 void
@@ -123,7 +129,7 @@
 void *
 dga_draw_get_client_infop (Dga_drawable dgadraw)
 {
-    void *rval;
+    void *rval = NULL;
 #ifdef MT
     mutex_lock(&dgaGlobalMutex);
 #endif
@@ -144,7 +150,7 @@
 int
 dga_draw_devinfochg (Dga_drawable dgadraw)
 {
-    int rval;
+    int rval = -1;
 
 #ifdef MT
     mutex_lock(&dgaGlobalMutex);
@@ -166,7 +172,7 @@
 void *
 dga_draw_devinfo (Dga_drawable dgadraw)
 {
-    void *rval;
+    void *rval = NULL;
 
 #ifdef MT
     mutex_lock(&dgaGlobalMutex);
@@ -188,7 +194,7 @@
 int
 dga_draw_sitechg (Dga_drawable dgadraw, int *reason)
 {
-    int rval;
+    int rval = -1;
 
 #ifdef MT
     mutex_lock(&dgaGlobalMutex);
@@ -250,7 +256,7 @@
 int
 dga_draw_site (Dga_drawable dgadraw)
 {
-    int rval;
+    int rval = -1;
 
 #ifdef MT
     mutex_lock(&dgaGlobalMutex);
@@ -272,7 +278,7 @@
 void *
 dga_draw_address (Dga_drawable dgadraw)
 {
-    void *rval;
+    void *rval = NULL;
 
 #ifdef MT
     mutex_lock(&dgaGlobalMutex);
@@ -294,7 +300,7 @@
 int
 dga_draw_linebytes (Dga_drawable dgadraw)
 {
-    int rval;
+    int rval = -1;
 
 #ifdef MT
     mutex_lock(&dgaGlobalMutex);
@@ -316,7 +322,7 @@
 int
 dga_draw_bitsperpixel (Dga_drawable dgadraw)
 {
-    int rval;
+    int rval = -1;
 
 #ifdef MT
     mutex_lock(&dgaGlobalMutex);
@@ -338,7 +344,7 @@
 int
 dga_draw_clipchg (Dga_drawable dgadraw)
 {
-    int rval;
+    int rval = -1;
 
 #ifdef MT
     mutex_lock(&dgaGlobalMutex);
@@ -379,7 +385,7 @@
 int
 dga_draw_visibility (Dga_drawable dgadraw)
 { 
-    int rval;
+    int rval = -1;
 
 #ifdef MT
     mutex_lock(&dgaGlobalMutex);
@@ -402,7 +408,7 @@
 int
 dga_draw_empty (Dga_drawable dgadraw)
 { 
-    int rval;
+    int rval = -1;
 
 #ifdef MT
     mutex_lock(&dgaGlobalMutex);
@@ -424,7 +430,7 @@
 short *
 dga_draw_clipinfo (Dga_drawable dgadraw)
 {
-    short *rval;
+    short *rval = NULL;
 
 #ifdef MT
     mutex_lock(&dgaGlobalMutex);
@@ -457,6 +463,7 @@
 	rval = dgai_mbsmemb_singlerect((_Dga_window)dgadraw);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* always a single rect */
 	rval = 1;
 	break;
@@ -480,6 +487,7 @@
 	rval = dgai_mbsmemb_obscured((_Dga_window)dgadraw);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* never obscured */
 	rval = 0;
 	break;
@@ -505,6 +513,7 @@
 	rval = dgai_mbsmemb_borderwidth((_Dga_window)dgadraw);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* always 0 */
 	rval = 0;
 	break;
@@ -550,6 +559,7 @@
 	rval = dgai_mbsmemb_rtngrab((_Dga_window)dgadraw);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps */
 	rval = 0;
 	break;
@@ -573,6 +583,7 @@
 	rval = dgai_mbsmemb_rtnungrab((_Dga_window)dgadraw);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps */
 	rval = 0;
 	break;
@@ -596,6 +607,7 @@
 	rval = dgai_mbsmemb_rtnchg((_Dga_window)dgadraw);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps -- force a query for active */
 	rval = 1;
 	break;
@@ -619,6 +631,7 @@
 	rval = dgai_mbsmemb_rtnactive((_Dga_window)dgadraw);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps -- never active */
 	rval = 0;
 	break;
@@ -642,6 +655,7 @@
 	rval = dgai_mbsmemb_rtncached((_Dga_window)dgadraw);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps -- consider never cached */
 	rval = 0;
 	break;
@@ -665,6 +679,7 @@
 	rval = dgai_mbsmemb_rtndevinfop((_Dga_window)dgadraw);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps -- doesn't have devinfo */
 	rval = NULL;
 	break;
@@ -696,6 +711,7 @@
 	dgai_mbsmemb_rtndevtype((_Dga_window)dgadraw, type, name);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps -- no dev type and name */
 	*type = (u_char) 0;
 	*name = NULL;
@@ -718,6 +734,7 @@
 	dgai_mbsmemb_rtndimensions((_Dga_window)dgadraw, width, height, linebytes);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps -- no dimensions */
 	*width = 0;
 	*height = 0;
@@ -742,6 +759,7 @@
 	rval = dgai_mbsmemb_rtnbitsperpixel((_Dga_window)dgadraw);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps */
 	rval = 0;
 	break;
@@ -765,6 +783,7 @@
 	rval = dgai_mbsmemb_rtnpixels((_Dga_window)dgadraw);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps -- doesn't have retained pixels */
 	rval = NULL;
 	break;
@@ -788,6 +807,7 @@
 	rval = dga_win_widinfop((Dga_window)dgadraw);
 	break;
     case DGA_DRAW_PIXMAP:
+    default:
 	/* not applicable to pixmaps -- doesn't have retained pixels */
 	rval = NULL;
 	break;
@@ -809,6 +829,7 @@
     case DGA_DRAW_WINDOW:
 	return (dgai_mbsmemb_mbchg((_Dga_window)dgadraw, reason));
     case DGA_DRAW_PIXMAP:
+    default:
 	/* pixmaps never are multibuffered */
 	return (0);
     }
@@ -850,6 +871,7 @@
     case DGA_DRAW_WINDOW:
 	return (dgai_mbsmemb_mbaccessmode((_Dga_window)dgadraw));
     case DGA_DRAW_PIXMAP:
+    default:
 	return (DGA_MBACCESS_NONE);
     }
 }
@@ -861,6 +883,7 @@
     case DGA_DRAW_WINDOW:
 	return (dgai_mbsmemb_mbsitetypeconst((_Dga_window)dgadraw));
     case DGA_DRAW_PIXMAP:
+    default:
 	/* can't tell for pixmaps - be conservative */
 	return (0);
     }
@@ -902,6 +925,7 @@
     case DGA_DRAW_WINDOW:
 	return (dgai_mbsmemb_ovlstatechg((_Dga_window)dgadraw));
     case DGA_DRAW_PIXMAP:
+    default:
 	/* Pixmaps never have an ovlstate */
 	return (0);
     }
@@ -914,6 +938,7 @@
     case DGA_DRAW_WINDOW:
 	return (dgai_mbsmemb_ovlstate((_Dga_window)dgadraw));
     case DGA_DRAW_PIXMAP:
+    default:
 	/* Pixmaps never have an ovlstate */
 	return (DGA_OVLSTATE_CONFLICT);
     }
--- a/open-src/lib/libdga/sun-src/pix_grab.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/lib/libdga/sun-src/pix_grab.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,4 +1,4 @@
-/* Copyright (c) 1993, 2004, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 1993, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -206,6 +206,8 @@
         i = 0;
         while ((i < SHPX_MAX_CLIENTS) && (shpx_client_directory[i].cid != 0))
         	i++;
+        if (i >= SHPX_MAX_CLIENTS)
+        	return(0);
         if ((c_fd = open(c_fn,O_RDWR ,0666)) < 0) 
         	return(0);
         /* map the shpx directory for this client and map at 4 megabytes */
@@ -303,7 +305,7 @@
     clientp->p_lock_func = NULL;
     clientp->p_unlock_func = NULL;
 #endif
-    clientp->p_update_func = (int(*)())dgai_pix_update;
+    clientp->p_update_func = dgai_pix_update;
     clientp->p_shpx_client = NULL;
     clientp->p_token = token;
     clientp->c_size = infop->s_size;
@@ -400,8 +402,7 @@
         	    (shpx_client_directory[i].cid != pixlist->p_token)) {
                 i++;
 	    }
-            if ((i == SHPX_MAX_CLIENTS) &&
-        	    (Dga_shpx_client_count == SHPX_MAX_CLIENTS)) {
+            if (i >= SHPX_MAX_CLIENTS) {
                 return;
             }
 	    shpx_client_directory[i].npix--;
--- a/open-src/lib/libdga/sun-src/win_grab.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/lib/libdga/sun-src/win_grab.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,4 +1,4 @@
-/* Copyright (c) 1993, 2003, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 1993, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -390,6 +390,7 @@
 	    		fprintf(stderr, 
 "wx_grab: mismatch on shared WXINFO size info page is %d sizeof is %d \n",
 				infop->info_sz, sizeof(WXINFO));
+				free(new_clientp);
 				return(NULL);
 			}
 			new_clientp->drawable_type = DGA_DRAW_WINDOW;
@@ -495,6 +496,7 @@
 	sprintf(filename, "%s%08x", GRABFILE, token);
 
         if ((filefd = open(filename,O_RDWR,0666))<0) {
+	    safe_free_clientp(clientp) ;
 	    return((Dga_window)NULL);
 	}
 
@@ -518,7 +520,10 @@
 	"wx_grab: mismatch on WXINFO size info page is %d sizeof is %d \n",
 			infop->info_sz, sizeof(WXINFO));
 #endif
-				return(NULL);
+	    munmap((caddr_t)infop, MAXSHMEMSIZE) ;
+	    close(filefd) ;
+	    safe_free_clientp(clientp) ;
+	    return(NULL);
 	}
 
 	/* open the frame buffer if not already opened by client */
@@ -1808,5 +1813,6 @@
 	dgawin = (_Dga_window) dgadraw;
 	mutex_unlock(dgawin->mutexp);
     }
+    return Success;
 }
 #endif
--- a/open-src/xserver/Makefile.inc	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/xserver/Makefile.inc	Wed Aug 19 17:35:59 2015 -0700
@@ -1,6 +1,6 @@
 # -*- Makefile -*- rules common to all xserver build trees
 #
-# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -71,9 +71,6 @@
 	--with-default-xkb-model=pc105 \
 	$(ADDITIONAL_CONFIG_OPTS)
 
-# Xorg's unit tests don't build correctly with parfait yet
-$(WITH_PARFAIT) XSERVER_CONFIG_OPTS_COMMON += --disable-unit-tests
-
 XSERVER_CONFIG_OPTS_sparc=$(XSERVER_CONFIG_OPTS_COMMON)
 XSERVER_CONFIG_OPTS_i386=$(XSERVER_CONFIG_OPTS_COMMON)
 XSERVER_CONFIG_OPTS=$(XSERVER_CONFIG_OPTS_$(MACH))
--- a/open-src/xserver/xorg/sun-src/IA/interactive.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/xserver/xorg/sun-src/IA/interactive.c	Wed Aug 19 17:35:59 2015 -0700
@@ -606,7 +606,7 @@
 		  case SET_INTERACTIVE:	cmdmsg = "SET_INTERACTIVE"; 	break;
 		  default:		cmdmsg = "UNKNOWN_CMD!!!"; 	break;
 		}
-		LogMessage(X_INFO, "SolarisIA: SetPriority(%ld, %s): %s\n",
+		LogMessage(X_INFO, "SolarisIA: SetPriority(%d, %s): %s\n",
 			   pid, cmdmsg,
 			   (ret == Success) ? "succeeeded" : "failed");
 	    });
--- a/open-src/xserver/xorg/sun-src/os/dtlogin.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/xserver/xorg/sun-src/os/dtlogin.c	Wed Aug 19 17:35:59 2015 -0700
@@ -146,7 +146,7 @@
     dmd = calloc(1, sizeof(struct dmdata));
     if (dmd == NULL) {
 	DtloginError("Failed to allocate %d bytes for display manager pipe",
-		     sizeof(struct dmdata));
+		     (int) sizeof(struct dmdata));
 	return;
     }
 
@@ -569,7 +569,7 @@
 		    } else {
 			DtloginError("Failed to allocate %d bytes"
 				     " for uid reset info",
-				     sizeof(struct dmScreenPriv));
+				     (int) sizeof(struct dmScreenPriv));
 		    }
 		}
 	    } else {
--- a/open-src/xserver/xorg/sun-src/tsol/auditwrite.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/xserver/xorg/sun-src/tsol/auditwrite.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -1185,7 +1185,7 @@
 static int
 aw_gen_rec(int param, va_list arglist)
 {
-	void *ad[8];			/* attribute data */
+	void *ad[8] = { NULL };		/* attribute data */
 	token_t *tokp;			/* token for converted data */
 	int a;				/* invocation line argument */
 	au_event_ent_t *auevent;	/* event for this call */
@@ -1910,7 +1910,7 @@
 {
 	int a;
 	au_event_ent_t *auevent;
-	void *ad[8]; /* argument data */
+	void *ad[8] = { NULL }; /* argument data */
 
 	/*
 	 * During the port from TS 2, we had to slightly reorg code, thus
@@ -2499,7 +2499,7 @@
 aw_set_context(int param, va_list arglist)
 {
 	int a;
-	void *ad[8]; /* argument data */
+	void *ad[8] = { NULL }; /* argument data */
 
 	a = param;
 
--- a/open-src/xserver/xorg/sun-src/tsol/tsolpolicy.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/xserver/xorg/sun-src/tsol/tsolpolicy.c	Wed Aug 19 17:35:59 2015 -0700
@@ -315,7 +315,7 @@
 
 	Mask check_mode = access_mode;
 	TsolInfoPtr tsolinfo = GetClientTsolInfo(client);
-	TsolResPtr  tsolres;
+	TsolResPtr  tsolres = NULL;
 	xpolicy_t flags;
 	int reqtype;
 
@@ -537,6 +537,7 @@
 		break;
 	default:
 		err_code = BadValue;
+		object_code = AW_END;
 		break;
 	}
 
--- a/open-src/xserver/xorg/sun-src/tsol/tsolutils.c	Thu Aug 20 14:41:17 2015 -0700
+++ b/open-src/xserver/xorg/sun-src/tsol/tsolutils.c	Wed Aug 19 17:35:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -630,6 +630,7 @@
 		value = strtok(NULL, " \t\n");
 		UpdateTsolConfig(keyword, value);
 	}
+	fclose(fp);
 
 	InitPrivileges();
 }