This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.16-ports-merge-138-gbf9b740
- From: vapier at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 7 Aug 2012 23:17:08 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.16-ports-merge-138-gbf9b740
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via bf9b740a119eecf01499b4de0dc8cbd27b7c47bd (commit)
from 93df14eee81cf5514fe96e9143201a75d9391c7b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bf9b740a119eecf01499b4de0dc8cbd27b7c47bd
commit bf9b740a119eecf01499b4de0dc8cbd27b7c47bd
Author: Allan McRae <allan@archlinux.org>
Date: Sat Aug 4 12:19:09 2012 +1000
rpcgen - fall back to looking for cpp in system path
Fall back to the system cpp when /lib/cpp is not present. Removes
searching for /usr/ccs/lib/cpp which is not supported on any system that
uses glibc.
diff --git a/ChangeLog b/ChangeLog
index b2c8cdf..8078f8a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-08-07 Allan McRae <allan@archlinux.org>
+
+ [BZ #14303]
+ * sunrpc/rpc_main.c (SVR4_CPP): Remove.
+ (SUNOS_CPP): Likewise.
+ (find_cpp): Fall back to selecting system cpp when /lib/cpp is
+ not found.
+ (open_input): Call CPP using execvp.
+
2012-08-07 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/kernel-features.h
diff --git a/sunrpc/rpc_main.c b/sunrpc/rpc_main.c
index 06d951a..2103b10 100644
--- a/sunrpc/rpc_main.c
+++ b/sunrpc/rpc_main.c
@@ -75,12 +75,9 @@ struct commandline
static const char *cmdname;
-#define SVR4_CPP "/usr/ccs/lib/cpp"
-#define SUNOS_CPP "/lib/cpp"
-
static const char *svcclosetime = "120";
static int cppDefined; /* explicit path for C preprocessor */
-static const char *CPP = SUNOS_CPP;
+static const char *CPP = "/lib/cpp";
static const char CPPFLAGS[] = "-C";
static char *pathbuf;
static int cpp_pid;
@@ -327,23 +324,17 @@ 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 ();
- }
- }
+ if (stat (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";
}
/*
@@ -374,8 +365,13 @@ open_input (const char *infile, const char *define)
close (1);
dup2 (pd[1], 1);
close (pd[0]);
- execv (arglist[0], (char **) arglist);
- perror ("execv");
+ execvp (arglist[0], (char **) arglist);
+ if (errno == ENOENT)
+ {
+ fprintf (stderr, _ ("cannot find C preprocessor: %s\n"), CPP);
+ exit (1);
+ }
+ perror ("execvp");
exit (1);
case -1:
perror ("fork");
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 9 +++++++++
sunrpc/rpc_main.c | 40 ++++++++++++++++++----------------------
2 files changed, 27 insertions(+), 22 deletions(-)
hooks/post-receive
--
GNU C Library master sources