nixpkgs/pkgs/development/libraries/glibc/rpcgen-path.patch
2020-01-14 08:26:58 +00:00

54 lines
1.5 KiB
Diff

--- a/sunrpc/rpc_main.c
+++ b/sunrpc/rpc_main.c
@@ -78,7 +78,7 @@ static const char *cmdname;
static const char *svcclosetime = "120";
static int cppDefined; /* explicit path for C preprocessor */
-static const char *CPP = "/lib/cpp";
+static const char *CPP = "cpp";
static const char CPPFLAGS[] = "-C";
static char *pathbuf;
static int cpp_pid;
@@ -107,7 +107,6 @@ static char *extendfile (const char *file, const char *ext);
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,
@@ -322,25 +321,6 @@ clear_args (void)
argcount = FIXEDARGS;
}
-/* make sure that a CPP exists */
-static void
-find_cpp (void)
-{
- struct stat64 buf;
-
- if (stat64 (CPP, &buf) == 0)
- return;
-
- if (cppDefined) /* user specified cpp but it does not exist */
- {
- fprintf (stderr, _ ("cannot find C preprocessor: %s\n"), CPP);
- crash ();
- }
-
- /* fall back to system CPP */
- CPP = "cpp";
-}
-
/*
* Open input file with given define for C-preprocessor
*/
@@ -359,7 +339,6 @@ open_input (const char *infile, const char *define)
switch (cpp_pid)
{
case 0:
- find_cpp ();
putarg (0, CPP);
putarg (1, CPPFLAGS);
addarg (define);