--- old/usr/src/cmd/rpcgen/rpc_main.c	Sun Aug  3 11:09:16 2014
+++ new/usr/src/cmd/rpcgen/rpc_main.c	Sun Aug  3 11:09:16 2014
@@ -20,6 +20,8 @@
  */
 
 /*
+ * Copyright 2014 Garrett D'Amore <garrett@damore.org>
+ *
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -136,7 +138,6 @@
 int exitnow;		/* If started by port monitors, exit after the call */
 int timerflag;		/* TRUE if !indefinite && !exitnow */
 int newstyle;		/* newstyle of passing arguments (by value) */
-int Cflag = 0;		/* ANSI C syntax */
 int CCflag = 0;		/* C++ files */
 static int allfiles;   /* generate all files */
 int tirpcflag = 1;    /* generating code for tirpc, by default */
@@ -515,7 +516,6 @@
 	char *guard;
 	list *l;
 	xdrfunc *xdrfuncp;
-	int i;
 
 	open_input(infile, define);
 	outfilename =  extend ? extendfile(infile, outfile) : outfile;
@@ -538,13 +538,13 @@
 	};
 
 	/* put the C++ support */
-	if (Cflag && !CCflag) {
+	if (!CCflag) {
 		f_print(fout, "\n#ifdef __cplusplus\n");
 		f_print(fout, "extern \"C\" {\n");
 		f_print(fout, "#endif\n\n");
 	}
 
-	/* put in a typedef for quadprecision. Only with Cflag */
+	/* put in a typedef for quadprecision. */
 
 	/*
 	 * declaration of struct rpcgen_table must go before
@@ -582,30 +582,14 @@
 			f_print(fout, "#endif\n");
 		}
 
-		if (!Cflag) {
-			xdrfuncp = xdrfunc_head;
-			while (xdrfuncp != NULL) {
-				print_xdr_func_def(xdrfuncp->name,
-				    xdrfuncp->pointerp, 2);
-				xdrfuncp = xdrfuncp->next;
-			}
-		} else {
-			for (i = 1; i < 3; i++) {
-				if (i == 1)
-					f_print(fout,
-"\n#if defined(__STDC__) || defined(__cplusplus)\n");
-				else
-					f_print(fout, "\n#else /* K&R C */\n");
+		f_print(fout, "\n");
 
-				xdrfuncp = xdrfunc_head;
-				while (xdrfuncp != NULL) {
-					print_xdr_func_def(xdrfuncp->name,
-					    xdrfuncp->pointerp, i);
-					xdrfuncp = xdrfuncp->next;
-				}
-			}
-			f_print(fout, "\n#endif /* K&R C */\n");
+		xdrfuncp = xdrfunc_head;
+		while (xdrfuncp != NULL) {
+			print_xdr_func_def(xdrfuncp->name, xdrfuncp->pointerp);
+			xdrfuncp = xdrfuncp->next;
 		}
+		f_print(fout, "\n");
 	}
 
 	if (extend && tell == ftell(fout)) {
@@ -612,11 +596,9 @@
 		(void) unlink(outfilename);
 	}
 
-	if (Cflag) {
-		f_print(fout, "\n#ifdef __cplusplus\n");
-		f_print(fout, "}\n");
-		f_print(fout, "#endif\n");
-	}
+	f_print(fout, "\n#ifdef __cplusplus\n");
+	f_print(fout, "}\n");
+	f_print(fout, "#endif\n");
 
 	f_print(fout, "\n#endif /* !_%s */\n", guard);
 }
@@ -647,11 +629,10 @@
 	f_print(fout, "#include <stdlib.h> /* getenv, exit */\n");
 	f_print(fout, "#include <signal.h>\n");
 
-	if (Cflag) {
-		f_print(fout,
-		"#include <rpc/pmap_clnt.h> /* for pmap_unset */\n");
-		f_print(fout, "#include <string.h> /* strcmp */\n");
-	}
+	f_print(fout,
+	"#include <rpc/pmap_clnt.h> /* for pmap_unset */\n");
+	f_print(fout, "#include <string.h> /* strcmp */\n");
+
 	if (strcmp(svcclosetime, "-1") == 0)
 		indefinitewait = 1;
 	else if (strcmp(svcclosetime, "0") == 0)
@@ -661,13 +642,12 @@
 
 	if (!tirpcflag && inetdflag)
 		f_print(fout, "#include <sys/termios.h> /* TIOCNOTTY */\n");
-	if (Cflag && (inetdflag || pmflag))
+	if (inetdflag || pmflag)
 		if (tirpcflag)
 			f_print(fout, "#include <unistd.h> /* setsid */\n");
 	if (tirpcflag)
 		f_print(fout, "#include <sys/types.h>\n");
 
-	f_print(fout, "#include <memory.h>\n");
 	f_print(fout, "#include <stropts.h>\n");
 	if (inetdflag || !tirpcflag) {
 		f_print(fout, "#include <sys/socket.h>\n");
@@ -683,10 +663,8 @@
 		f_print(fout, "#include <syslog.h>\n");
 
 	/* for ANSI-C */
-	if (Cflag)
-		f_print(fout,
-		    "\n#ifndef SIG_PF\n#define	SIG_PF void(*)\
-(int)\n#endif\n");
+	f_print(fout, "\n#ifndef SIG_PF\n"
+	    "#define	SIG_PF void(*)(int)\n#endif\n");
 
 	f_print(fout, "\n#ifdef DEBUG\n#define	RPC_SVC_FG\n#endif\n");
 	if (timerflag)
@@ -724,8 +702,7 @@
 	outfilename = extend ? extendfile(infile, outfile) : outfile;
 	open_output(infile, outfilename);
 	add_warning();
-	if (Cflag)
-		f_print(fout, "#include <memory.h> /* for memset */\n");
+	f_print(fout, "#include <memory.h> /* for memset */\n");
 	if (infile && (include = extendfile(infile, ".h"))) {
 		f_print(fout, "#include \"%s\"\n", include);
 		free(include);
@@ -1102,12 +1079,12 @@
 						return (0);
 					flag[ch] = 1;
 					break;
-				case 'C': /* ANSI C syntax */
-					Cflag = 1;
+				case 'C': /* ANSI C syntax (default) */
 					ch = argv[i][j+1]; /* get next char */
 
 					if (ch != 'C')
 						break;
+					/* Undocumented C++ mode */
 					CCflag = 1;
 					break;
 				case 'b':
