Skip to content

Commit

Permalink
Merge remote branch 'origin/master' into fedora/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Schwab committed Sep 14, 2009
2 parents 85cf374 + 02bf610 commit a31519c
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 69 deletions.
19 changes: 19 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
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.

2009-09-08 Jakub Jelinek <jakub@redhat.com>

* sysdeps/s390/s390-32/____longjmp_chk.c: Removed.
* sysdeps/s390/s390-64/____longjmp_chk.c: Removed.
* sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c: New file.
* sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c: New file.

2009-09-07 Ulrich Drepper <drepper@redhat.com>

* locale/programs/ld-collate.c (struct locale_collate_t): Add
unnamed_section_defined field.
(collate_read): Test and set unnamed_section_defined.

* posix/getconf.c (vars): Handle POSIX2_LINE_MAX in addition to
_POSIX2_LINE_MAX.

Expand Down
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -4841,7 +4841,7 @@ $as_echo_n "checking version of $AS... " >&6; }
ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
2.1[3-9]*|[2-9].[2-9]*)
2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9]*|[3-9].*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
Expand Down Expand Up @@ -4904,7 +4904,7 @@ $as_echo_n "checking version of $LD... " >&6; }
ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
2.1[3-9]*|[2-9].[2-9]*)
2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9]*|3-9.*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
Expand Down
4 changes: 2 additions & 2 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -897,10 +897,10 @@ AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
# Accept binutils 2.13 or newer.
AC_CHECK_PROG_VER(AS, $AS, --version,
[GNU assembler.* \([0-9]*\.[0-9.]*\)],
[2.1[3-9]*|[2-9].[2-9]*], AS=: critic_missing="$critic_missing as")
[2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9]*|[3-9].*], AS=: critic_missing="$critic_missing as")
AC_CHECK_PROG_VER(LD, $LD, --version,
[GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
[2.1[3-9]*|[2-9].[2-9]*], LD=: critic_missing="$critic_missing ld")
[2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9]*]|[3-9].*, LD=: critic_missing="$critic_missing ld")

# We need the physical current working directory. We cannot use the
# "pwd -P" shell builtin since that's not portable. Instead we try to
Expand Down
59 changes: 31 additions & 28 deletions locale/programs/ld-collate.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1995-2003, 2005-2007, 2008 Free Software Foundation, Inc.
/* Copyright (C) 1995-2003, 2005-2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
Expand Down Expand Up @@ -203,6 +203,8 @@ struct locale_collate_t
struct section_list *current_section;
/* There always can be an unnamed section. */
struct section_list unnamed_section;
/* Flag whether the unnamed section has been defined. */
bool unnamed_section_defined;
/* To make handling of errors easier we have another section. */
struct section_list error_section;
/* Sometimes we are defining the values for collating symbols before
Expand Down Expand Up @@ -634,7 +636,7 @@ find_element (struct linereader *ldfile, struct locale_collate_t *collate,
if (find_entry (&collate->seq_table, str, len, &result) != 0)
{
/* Nope, not define yet. So we see whether it is a
collation symbol. */
collation symbol. */
void *ptr;

if (find_entry (&collate->sym_table, str, len, &ptr) == 0)
Expand Down Expand Up @@ -788,7 +790,7 @@ insert_weights (struct linereader *ldfile, struct element_t *elem,
if (*cp == '<')
{
/* Ahh, it's a bsymbol or an UCS4 value. If it's
the latter we have to unify the name. */
the latter we have to unify the name. */
const char *startp = ++cp;
size_t len;

Expand Down Expand Up @@ -1302,8 +1304,8 @@ order for `%.*s' already defined at %s:%Zu"),
else
{
/* Determine the range. To do so we have to determine the
common prefix of the both names and then the numeric
values of both ends. */
common prefix of the both names and then the numeric
values of both ends. */
size_t lenfrom = strlen (startp->name);
size_t lento = strlen (endp->name);
char buf[lento + 1];
Expand Down Expand Up @@ -2222,14 +2224,14 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
else
{
/* The entries in the list are sorted by length and then
alphabetically. This is the order in which we will add the
elements to the collation table. This allows simply walking
alphabetically. This is the order in which we will add the
elements to the collation table. This allows simply walking
the table in sequence and stopping at the first matching
entry. Since the longer sequences are coming first in the
list they have the possibility to match first, just as it
has to be. In the worst case we are walking to the end of
the list where we put, if no singlebyte sequence is defined
in the locale definition, the weights for UNDEFINED.
entry. Since the longer sequences are coming first in the
list they have the possibility to match first, just as it
has to be. In the worst case we are walking to the end of
the list where we put, if no singlebyte sequence is defined
in the locale definition, the weights for UNDEFINED.
To reduce the length of the search list we compress them a bit.
This happens by collecting sequences of consecutive byte
Expand Down Expand Up @@ -2297,7 +2299,7 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
obstack_1grow_fast (&extrapool, curp->mbs[i]);

/* Now find the end of the consecutive sequence and
add all the indeces in the indirect pool. */
add all the indeces in the indirect pool. */
do
{
weightidx = output_weight (&weightpool, collate, curp);
Expand All @@ -2312,7 +2314,7 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
obstack_int32_grow (&indirectpool, weightidx);

/* And add the end byte sequence. Without length this
time. */
time. */
for (i = 1; i < curp->nmbs; ++i)
obstack_1grow_fast (&extrapool, curp->mbs[i]);
}
Expand Down Expand Up @@ -2356,7 +2358,7 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
& (__alignof__ (int32_t) - 1)) == 0);

/* If the final entry in the list is not a single character we
add an UNDEFINED entry here. */
add an UNDEFINED entry here. */
if (lastp->nmbs != 1)
{
int added = ((sizeof (int32_t) + 1 + 1 + __alignof__ (int32_t) - 1)
Expand Down Expand Up @@ -3293,7 +3295,7 @@ error while adding equivalent collating symbol"));
else
{
/* One should not be allowed to open the same
section twice. */
section twice. */
if (sp->first != NULL)
lr_error (ldfile, _("\
%s: multiple order definitions for section `%s'"),
Expand Down Expand Up @@ -3349,7 +3351,7 @@ error while adding equivalent collating symbol"));
section. */
collate->current_section = &collate->unnamed_section;

if (collate->unnamed_section.first != NULL)
if (collate->unnamed_section_defined)
lr_error (ldfile, _("\
%s: multiple order definitions for unnamed section"),
"LC_COLLATE");
Expand All @@ -3359,6 +3361,7 @@ error while adding equivalent collating symbol"));
the collate->sections list. */
collate->unnamed_section.next = collate->sections;
collate->sections = &collate->unnamed_section;
collate->unnamed_section_defined = true;
}
}

Expand Down Expand Up @@ -3579,9 +3582,9 @@ error while adding equivalent collating symbol"));
else
{
/* This is bad. The section after which we have to
reorder does not exist. Therefore we cannot
process the whole rest of this reorder
specification. */
reorder does not exist. Therefore we cannot
process the whole rest of this reorder
specification. */
lr_error (ldfile, _("%s: section `%.*s' not known"),
"LC_COLLATE", (int) arg->val.str.lenmb,
arg->val.str.startmb);
Expand Down Expand Up @@ -3657,9 +3660,9 @@ error while adding equivalent collating symbol"));
if (state == 0)
{
/* We are outside an `order_start' region. This means
we must only accept definitions of values for
collation symbols since these are purely abstract
values and don't need directions associated. */
we must only accept definitions of values for
collation symbols since these are purely abstract
values and don't need directions associated. */
void *ptr;

if (find_entry (&collate->seq_table, symstr, symlen, &ptr) == 0)
Expand Down Expand Up @@ -3741,7 +3744,7 @@ error while adding equivalent collating symbol"));
seqp->next->last = seqp->last;

/* We also have to check whether this entry is the
first or last of a section. */
first or last of a section. */
if (seqp->section->first == seqp)
{
if (seqp->section->first == seqp->section->last)
Expand Down Expand Up @@ -3798,7 +3801,7 @@ error while adding equivalent collating symbol"));
}

/* Process the rest of the line which might change
the collation rules. */
the collation rules. */
arg = lr_token (ldfile, charmap, result, repertoire,
verbose);
if (arg->tok != tok_eof && arg->tok != tok_eol)
Expand All @@ -3810,8 +3813,8 @@ error while adding equivalent collating symbol"));
else if (was_ellipsis != tok_none)
{
/* Using the information in the `ellipsis_weight'
element and this and the last value we have to handle
the ellipsis now. */
element and this and the last value we have to handle
the ellipsis now. */
assert (state == 1);

handle_ellipsis (ldfile, symstr, symlen, was_ellipsis, charmap,
Expand Down Expand Up @@ -3871,7 +3874,7 @@ error while adding equivalent collating symbol"));
case tok_ellipsis3: /* absolute ellipsis */
case tok_ellipsis4: /* symbolic decimal ellipsis */
/* This is the symbolic (decimal or hexadecimal) or absolute
ellipsis. */
ellipsis. */
if (was_ellipsis != tok_none)
goto err_label;

Expand Down
4 changes: 4 additions & 0 deletions nptl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2009-09-07 Andreas Schwab <schwab@redhat.com>

* sysdeps/pthread/bits/libc-lock.h (BP_SYM): Remove space before paren.

2009-09-02 Suzuki K P <suzuki@in.ibm.com>
Joseph Myers <joseph@codesourcery.com>

Expand Down
2 changes: 1 addition & 1 deletion nptl/sysdeps/pthread/bits/libc-lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ extern int __pthread_atfork (void (*__prepare) (void),
# if _LIBC
# include <bp-sym.h>
# else
# define BP_SYM (sym) sym
# define BP_SYM(sym) sym
# endif
weak_extern (BP_SYM (__pthread_mutex_init))
weak_extern (BP_SYM (__pthread_mutex_destroy))
Expand Down
72 changes: 38 additions & 34 deletions posix/getconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -1239,28 +1239,32 @@ 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;
char *cvalue;
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"));
}
Expand All @@ -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)
Expand All @@ -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);
Expand All @@ -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;
}
Loading

0 comments on commit a31519c

Please sign in to comment.