summary refs log tree commit diff
path: root/pkgs/development/libraries/glibc/2.14/rpcgen-path.patch
blob: fbb03dd5fadee56d341e5e8d845bbaf6e0c4a8e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
By default, rpcgen(1) looks for cpp(1) from a list of fixed absolute paths
(`/lib/cpp', etc.), which may only be overrided with the `-Y' option.  This
patch makes it run any `cpp' command found in $PATH.

--- glibc-2.7/sunrpc/rpc_main.c	2006-11-10 21:54:46.000000000 +0100
+++ glibc-2.7/sunrpc/rpc_main.c	2009-04-22 14:32:10.000000000 +0200
@@ -79,7 +79,7 @@ static const char *cmdname;
 
 static const char *svcclosetime = "120";
 static int cppDefined;	/* explicit path for C preprocessor */
-static const char *CPP = SUNOS_CPP;
+static const char *CPP = "cpp";
 static const char CPPFLAGS[] = "-C";
 static char *pathbuf;
 static int cpp_pid;
@@ -108,7 +108,6 @@ static char *extendfile (const char *fil
 static void open_output (const char *infile, const char *outfile);
 static void add_warning (void);
 static void clear_args (void);
-static void find_cpp (void);
 static void open_input (const char *infile, const char *define);
 static int check_nettype (const char *name, const char *list_to_check[]);
 static void c_output (const char *infile, const char *define,
@@ -327,31 +326,6 @@ clear_args (void)
   argcount = FIXEDARGS;
 }
 
-/* make sure that a CPP exists */
-static void
-find_cpp (void)
-{
-  struct stat buf;
-
-  if (stat (CPP, &buf) < 0)
-    {				/* /lib/cpp or explicit cpp does not exist */
-      if (cppDefined)
-	{
-	  fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP);
-	  crash ();
-	}
-      else
-	{			/* try the other one */
-	  CPP = SVR4_CPP;
-	  if (stat (CPP, &buf) < 0)
-	    {			/* can't find any cpp */
-	      fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout);
-	      crash ();
-	    }
-	}
-    }
-}
-
 /*
  * Open input file with given define for C-preprocessor
  */
@@ -370,7 +344,6 @@ open_input (const char *infile, const ch
   switch (cpp_pid)
     {
     case 0:
-      find_cpp ();
       putarg (0, CPP);
       putarg (1, CPPFLAGS);
       addarg (define);
@@ -380,7 +353,7 @@ open_input (const char *infile, const ch
       close (1);
       dup2 (pd[1], 1);
       close (pd[0]);
-      execv (arglist[0], (char **) arglist);
+      execvp (arglist[0], (char **) arglist);
       perror ("execv");
       exit (1);
     case -1: