mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-11 22:00:08 +00:00
b664d723de
* malloc/hooks.c (realloc_check): If mremap succeeds actually use the result. * sysdeps/i386/i486/bits/string.h: Add early clobber for "a" output parameter. Reported by Denis Zaitsev <zzz@cd-club.ru>. * Versions.def (libthread_db): Add GLIBC_2.3. 2002-07-09 Jakub Jelinek <jakub@redhat.com> * libio/freopen.c (freopen): Reset jump tables, use mmap stdio for the new stream if possible. * libio/freopen64.c (freopen64): Likewise. * libio/Makefile (tests): Add tst-freopen. * libio/tst-freopen.c: New file. 2002-07-03 Jakub Jelinek <jakub@redhat.com> * libio/stdio.h (obstack_printf): Add format attribute. (obstack_vprintf): Likewise. 2002-07-04 Jakub Jelinek <jakub@redhat.com> * posix/regex_internal.h (re_token_t): Shrink the structure to 8 resp. 16 bytes on 32-bit resp. 64-bit platforms. (re_charset_t, re_string_t): Reorder structure members for 64-bit architectures. 2002-07-04 Jakub Jelinek <jakub@redhat.com> * posix/regcomp.c (re_compile_internal): Move clearing of dfa... (init_dfa): ...here. 2002-07-05 Isamu Hasegawa <isamu@yamato.ibm.com> * posix/regcomp.c (parse_sub_exp): Add nodes OP_OPEN_SUBEXP and OP_CLOSE_SUBEXP at both ends of sub expressions instead of SUBEXP nodes in parse trees. (calc_first): Fix the Definition of `firsts' of OP_OPEN_SUBEXP and OP_CLOSE_SUBEXP, and remove the definition of SUBEXP. (calc_epsdest): Treat OP_OPEN_SUBEXP and OP_CLOSE_SUBEXP as the nodes which can epsilon transit. * posix/regex_internal.h: Add OP_OPEN_SUBEXP and OP_CLOSE_SUBEXP to IS_EPSILON_NODE macro. * posix/regexec.c (update_regs): New function to update registers by refering OP_OPEN_SUBEXP and OP_CLOSE_SUBEXP nodes. (proceed_next_node): Use the entities of the nodes to determine whether the node can transit to. (set_regs): Use update_regs function to update registers. 2002-07-03 Jakub Jelinek <jakub@redhat.com> * posix/bug-regex4.c (main): Remove duplicate setlocale. * posix/bug-regex6.c: New file. * posix/Makefile (tests): Add bug-regex6. (bug-regex6-ENV): Set LOCPATH. 2002-07-10 Ulrich Drepper <drepper@redhat.com>
78 lines
1.3 KiB
C
78 lines
1.3 KiB
C
#include <fcntl.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
|
|
static int do_test (void);
|
|
#define TEST_FUNCTION do_test ()
|
|
#include <test-skeleton.c>
|
|
|
|
|
|
static int
|
|
do_test (void)
|
|
{
|
|
char *buf;
|
|
int fd;
|
|
FILE *fp;
|
|
|
|
buf = (char *) malloc (strlen (test_dir) + sizeof "/tst-eof.XXXXXX");
|
|
if (buf == NULL)
|
|
{
|
|
printf ("cannot allocate memory: %m\n");
|
|
return 1;
|
|
}
|
|
stpcpy (stpcpy (buf, test_dir), "/tst-eof.XXXXXX");
|
|
|
|
fd = mkstemp (buf);
|
|
if (fd == -1)
|
|
{
|
|
printf ("cannot open temporary file: %m\n");
|
|
return 1;
|
|
}
|
|
|
|
/* Make sure it gets removed. */
|
|
add_temp_file (buf);
|
|
|
|
if (write (fd, "some string\n", 12) != 12)
|
|
{
|
|
printf ("cannot write temporary file: %m\n");
|
|
return 1;
|
|
}
|
|
|
|
if (lseek (fd, 0, SEEK_SET) == (off_t) -1)
|
|
{
|
|
printf ("cannot reposition temporary file: %m\n");
|
|
return 1;
|
|
}
|
|
|
|
fp = fdopen (fd, "r");
|
|
if (fp == NULL)
|
|
{
|
|
printf ("cannot create stream: %m\n");
|
|
return 1;
|
|
}
|
|
|
|
if (feof (fp))
|
|
{
|
|
puts ("EOF set after fdopen");
|
|
return 1;
|
|
}
|
|
|
|
if (fread (buf, 1, 20, fp) != 12)
|
|
{
|
|
puts ("didn't read the correct number of bytes");
|
|
return 1;
|
|
}
|
|
|
|
if (! feof (fp))
|
|
{
|
|
puts ("EOF not set after fread");
|
|
return 1;
|
|
}
|
|
|
|
fclose (fp);
|
|
|
|
return 0;
|
|
}
|