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.10-335-g02bf610
- From: drepper at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 10 Sep 2009 05:15:47 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.10-335-g02bf610
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 02bf610ca82f4b5660dadcfff04124e73f8ef2ff (commit)
from 0549ce8ec1f66a41c59815e50dd48ffd74fabb52 (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=02bf610ca82f4b5660dadcfff04124e73f8ef2ff
commit 02bf610ca82f4b5660dadcfff04124e73f8ef2ff
Author: Ulrich Drepper <drepper@redhat.com>
Date: Wed Sep 9 22:15:27 2009 -0700
Handle -- on getconf command line.
diff --git a/ChangeLog b/ChangeLog
index 16c976f..3dd4dc0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-09 Ulrich Drepper <drepper@redhat.com>
+
+ * posix/getconf.c (main): Handle -- on command line.
+
2009-09-05 H.J. Lu <hongjiu.lu@intel.com>
* configure.in: Support binutils 2.100 and 3.0.
diff --git a/posix/getconf.c b/posix/getconf.c
index facf5b0..d9d90e4 100644
--- a/posix/getconf.c
+++ b/posix/getconf.c
@@ -1052,34 +1052,34 @@ print_all (const char *path)
printf("%-35s", c->name);
switch (c->call) {
case PATHCONF:
- value = pathconf (path, c->call_name);
- if (value != -1) {
- printf("%ld", value);
- }
- printf("\n");
- break;
+ value = pathconf (path, c->call_name);
+ if (value != -1) {
+ printf("%ld", value);
+ }
+ printf("\n");
+ break;
case SYSCONF:
- value = sysconf (c->call_name);
- if (value == -1l) {
- if (c->call_name == _SC_UINT_MAX
- || c->call_name == _SC_ULONG_MAX)
- printf ("%lu", value);
- }
- else {
- printf ("%ld", value);
- }
- printf ("\n");
- break;
+ value = sysconf (c->call_name);
+ if (value == -1l) {
+ if (c->call_name == _SC_UINT_MAX
+ || c->call_name == _SC_ULONG_MAX)
+ printf ("%lu", value);
+ }
+ else {
+ printf ("%ld", value);
+ }
+ printf ("\n");
+ break;
case CONFSTR:
- clen = confstr (c->call_name, (char *) NULL, 0);
- cvalue = (char *) malloc (clen);
- if (cvalue == NULL)
- error (3, 0, _("memory exhausted"));
- if (confstr (c->call_name, cvalue, clen) != clen)
- error (3, errno, "confstr");
- printf ("%.*s\n", (int) clen, cvalue);
+ clen = confstr (c->call_name, (char *) NULL, 0);
+ cvalue = (char *) malloc (clen);
+ if (cvalue == NULL)
+ error (3, 0, _("memory exhausted"));
+ if (confstr (c->call_name, cvalue, clen) != clen)
+ error (3, errno, "confstr");
+ printf ("%.*s\n", (int) clen, cvalue);
free (cvalue);
- break;
+ break;
}
}
exit (0);
@@ -1239,13 +1239,17 @@ environment SPEC.\n\n"));
usage ();
}
- if (argc < 2 || argc > 3)
+ int ai = 1;
+ if (argc > ai && strcmp (argv[ai], "--") == 0)
+ ++ai;
+
+ if (argc - ai < 1 || argc - ai > 2)
usage ();
for (c = vars; c->name != NULL; ++c)
- if (strcmp (c->name, argv[1]) == 0
+ if (strcmp (c->name, argv[ai]) == 0
|| (strncmp (c->name, "_POSIX_", 7) == 0
- && strcmp (c->name + 7, argv[1]) == 0))
+ && strcmp (c->name + 7, argv[ai]) == 0))
{
long int value;
size_t clen;
@@ -1253,14 +1257,14 @@ environment SPEC.\n\n"));
switch (c->call)
{
case PATHCONF:
- if (argc < 3)
+ if (argc - ai < 2)
usage ();
errno = 0;
- value = pathconf (argv[2], c->call_name);
+ value = pathconf (argv[ai + 1], c->call_name);
if (value == -1)
{
if (errno)
- error (3, errno, "pathconf: %s", argv[2]);
+ error (3, errno, "pathconf: %s", argv[ai + 1]);
else
puts (_("undefined"));
}
@@ -1269,7 +1273,7 @@ environment SPEC.\n\n"));
exit (0);
case SYSCONF:
- if (argc > 2)
+ if (argc - ai > 1)
usage ();
value = sysconf (c->call_name);
if (value == -1l)
@@ -1285,7 +1289,7 @@ environment SPEC.\n\n"));
exit (0);
case CONFSTR:
- if (argc > 2)
+ if (argc - ai > 1)
usage ();
clen = confstr (c->call_name, (char *) NULL, 0);
cvalue = (char *) malloc (clen);
@@ -1300,7 +1304,7 @@ environment SPEC.\n\n"));
}
}
- error (2, 0, _("Unrecognized variable `%s'"), argv[1]);
+ error (2, 0, _("Unrecognized variable `%s'"), argv[ai]);
/* NOTREACHED */
return 2;
}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 +++
posix/getconf.c | 72 +++++++++++++++++++++++++++++--------------------------
2 files changed, 42 insertions(+), 34 deletions(-)
hooks/post-receive
--
GNU C Library master sources