2004-04-20  Jakub Jelinek  <jakub@redhat.com>
	* stdio-common/vfscanf.c (_IO_vfscanf): When skipping whitespace,
	do input_error () instead of conv_error () and don't look at errno.
	Don't eat any whitespace before %% if skip_space == 0.
	* stdio-common/tst-sscanf.c (int_tests): New array.
	(main): Run int_tests.
See ChangeLog.14 for earlier changes.
This commit is contained in:
Ulrich Drepper 2004-04-20 04:28:00 +00:00
parent a5dd0a6caf
commit d3b5202891
8 changed files with 16881 additions and 16778 deletions

16763
ChangeLog

File diff suppressed because it is too large Load Diff

16759
ChangeLog.14 Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2003 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -101,12 +101,43 @@
# define __local_disable_asynccancel __librt_disable_asynccancel
# endif
# if defined IS_IN_librt && defined PIC
# define CENABLE \
mov.l r12,@-r15; \
mov.l 1f,r12; \
mova 1f,r0; \
add r0,r12; \
mov.l 2f,r0; \
bsrf r0; \
nop; \
0: bra 3f; \
mov r0,r2; \
.align 2; \
1: .long _GLOBAL_OFFSET_TABLE_; \
2: .long __local_enable_asynccancel@PLT - (0b+2-.); \
3: mov.l @r15+,r12
# define CDISABLE \
mov.l r12,@-r15; \
mov.l 1f,r12; \
mova 1f,r0; \
add r0,r12; \
mov.l 2f,r0; \
bsrf r0; \
mov r2,r4; \
0: bra 3f; \
nop; \
.align 2; \
1: .long _GLOBAL_OFFSET_TABLE_; \
2: .long __local_disable_asynccancel@PLT - (0b+2-.); \
3: mov.l @r15+,r12
# else
# define CENABLE \
mov.l 1f,r0; \
bsrf r0; \
nop; \
0: bra 2f; \
nop; \
mov r0,r2; \
.align 2; \
1: .long __local_enable_asynccancel - 0b; \
2:
@ -114,12 +145,13 @@
# define CDISABLE \
mov.l 1f,r0; \
bsrf r0; \
nop; \
mov r2,r4; \
0: bra 2f; \
nop; \
.align 2; \
1: .long __local_disable_asynccancel - 0b; \
2:
# endif
# ifndef __ASSEMBLER__
# if defined FLOATING_STACKS && USE___THREAD && defined PIC

View File

@ -1,3 +1,10 @@
2004-04-19 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
* sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
info. Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2004-04-19 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2003 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -33,6 +33,7 @@
.globl sem_timedwait
.type sem_timedwait,@function
.align 5
cfi_startproc
sem_timedwait:
/* First check for cancellation. */
stc gbr, r0
@ -59,11 +60,22 @@ sem_timedwait:
1:
/* Check whether the timeout value is valid. */
mov.l r8, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r8, 0)
mov.l r9, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r9, 0)
mov.l r10, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r10, 0)
mov.l r12, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r12, 0)
sts.l pr, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (pr, 0)
add #-8, r15
cfi_adjust_cfa_offset(8)
mov r4, r8
mov r5, r9
@ -193,8 +205,10 @@ sem_timedwait:
stc gbr, r0
mov.w .Lclbuf, r1
mov.l .Lunwind, r2
jmp @r2
braf r2
mov.l @(r0,r1), r4
.Lunwindb:
cfi_endproc
.L1k:
.word 1000
@ -221,5 +235,5 @@ sem_timedwait:
.Ldisable0:
.long __pthread_disable_asynccancel-.Ldisable0b
.Lunwind:
.long __pthread_unwind
.long HIDDEN_JUMPTARGET (__pthread_unwind)-.Lunwindb
.size sem_timedwait,.-sem_timedwait

View File

@ -121,18 +121,10 @@ __new_sem_wait:
mov #-1, r0
9:
lds.l @r15+, pr
cfi_adjust_cfa_offset (-4)
cfi_restore (pr)
mov.l @r15+, r12
cfi_adjust_cfa_offset (-4)
cfi_restore (r12)
mov.l @r15+, r10
cfi_adjust_cfa_offset (-4)
cfi_restore (r10)
rts
mov.l @r15+, r8
cfi_adjust_cfa_offset (-4)
cfi_restore (r8)
5:
/* Canceled. */
stc gbr, r0
@ -144,8 +136,9 @@ __new_sem_wait:
stc gbr, r0
mov.w .Lclbuf, r1
mov.l .Lunwind, r2
jmp @r2
braf r2
mov.l @(r0,r1), r4
.Lunwindb:
cfi_endproc
.Lchand:
@ -169,6 +162,6 @@ __new_sem_wait:
.Ldisable0:
.long __pthread_disable_asynccancel-.Ldisable0b
.Lunwind:
.long __pthread_unwind
.long HIDDEN_JUMPTARGET (__pthread_unwind)-.Lunwindb
.size __new_sem_wait,.-__new_sem_wait
versioned_symbol(libpthread, __new_sem_wait, sem_wait, GLIBC_2_1)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000, 2002 Free Software Foundation, Inc.
/* Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
@ -59,6 +59,39 @@ const long int val_long[] =
-12345678, 987654321, 123456789, 987654321, 123456789, 987654321
};
struct int_test
{
const char *str;
const char *fmt;
int retval;
} int_tests[] =
{
{ "foo\n", "foo\nbar", -1 },
{ "foo\n", "foo bar", -1 },
{ "foo\n", "foo %d", -1 },
{ "foo\n", "foo\n%d", -1 },
{ "foon", "foonbar", -1 },
{ "foon", "foon%d", -1 },
{ "foo ", "foo bar", -1 },
{ "foo ", "foo %d", -1 },
{ "foo\t", "foo\tbar", -1 },
{ "foo\t", "foo bar", -1 },
{ "foo\t", "foo %d", -1 },
{ "foo\t", "foo\t%d", -1 },
{ "foo \t %bar1", "foo%%bar%d", 0 },
{ "foo", "foo", 0 },
{ "foon", "foo bar", 0 },
{ "foon", "foo %d", 0 },
{ "foo ", "fooxbar", 0 },
{ "foo ", "foox%d", 0 },
{ "foo bar", "foon", 0 },
{ "foo bar", "foo bar", 0 },
{ "foo bar", "foo %d", 0 },
{ "foo bar", "foon%d", 0 },
{ "foo ", "foo %n", 0 },
{ "foo%bar1", "foo%%bar%d", 1 }
};
int
main (void)
{
@ -119,5 +152,18 @@ main (void)
break;
}
for (i = 0; i < sizeof (int_tests) / sizeof (int_tests[0]); ++i)
{
int dummy, ret;
if ((ret = sscanf (int_tests[i].str, int_tests[i].fmt,
&dummy)) != int_tests[i].retval)
{
printf ("int_tests[%d] returned %d != %d\n",
i, ret, int_tests[i].retval);
result = 1;
}
}
return result;
}

View File

@ -396,8 +396,8 @@ _IO_vfscanf (s, format, argptr, errp)
if (skip_space)
{
while (ISSPACE (c))
if (inchar () == EOF && errno == EINTR)
conv_error ();
if (inchar () == EOF)
input_error ();
skip_space = 0;
}
@ -543,7 +543,8 @@ _IO_vfscanf (s, format, argptr, errp)
/* Find the conversion specifier. */
fc = *f++;
if (skip_space || (fc != L_('[') && fc != L_('c')
&& fc != L_('C') && fc != L_('n')))
&& fc != L_('C') && fc != L_('n')
&& fc != L_('%')))
{
/* Eat whitespace. */
int save_errno = errno;