mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-05 01:00:14 +00:00
Update.
* stdlib/canonicalize.c (canonicalize): Rename to __realpath and don't define static. Remove old __realpath function. TC1 of POSIX 2001 will allow the second parameter to be NULL. * stdlib/test-canon.c: Comment out test for NULL as second parameter of realpath. * time/offtime.c (__offtime): Set errno if overflow is detected.
This commit is contained in:
parent
4e960bbf4e
commit
f7501ae6f1
@ -1,5 +1,13 @@
|
|||||||
2002-05-15 Ulrich Drepper <drepper@redhat.com>
|
2002-05-15 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* stdlib/canonicalize.c (canonicalize): Rename to __realpath and
|
||||||
|
don't define static. Remove old __realpath function. TC1 of
|
||||||
|
POSIX 2001 will allow the second parameter to be NULL.
|
||||||
|
* stdlib/test-canon.c: Comment out test for NULL as second
|
||||||
|
parameter of realpath.
|
||||||
|
|
||||||
|
* time/offtime.c (__offtime): Set errno if overflow is detected.
|
||||||
|
|
||||||
* elf/Makefile (rtld-routines): Remove dl-brk and dl-sbrk.
|
* elf/Makefile (rtld-routines): Remove dl-brk and dl-sbrk.
|
||||||
* sysdeps/unix/sysv/linux/Makefile (sysdep-rtld-routines): Add
|
* sysdeps/unix/sysv/linux/Makefile (sysdep-rtld-routines): Add
|
||||||
dl-brk and dl-sbrk.
|
dl-brk and dl-sbrk.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Return the canonical absolute name of a given file.
|
/* Return the canonical absolute name of a given file.
|
||||||
Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
|
Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -37,8 +37,8 @@
|
|||||||
that cannot be resolved. If the path can be resolved, RESOLVED
|
that cannot be resolved. If the path can be resolved, RESOLVED
|
||||||
holds the same value as the value returned. */
|
holds the same value as the value returned. */
|
||||||
|
|
||||||
static char *
|
char *
|
||||||
canonicalize (const char *name, char *resolved)
|
__realpath (const char *name, char *resolved)
|
||||||
{
|
{
|
||||||
char *rpath, *dest, *extra_buf = NULL;
|
char *rpath, *dest, *extra_buf = NULL;
|
||||||
const char *start, *end, *rpath_limit;
|
const char *start, *end, *rpath_limit;
|
||||||
@ -204,25 +204,12 @@ error:
|
|||||||
free (rpath);
|
free (rpath);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
|
||||||
__realpath (const char *name, char *resolved)
|
|
||||||
{
|
|
||||||
if (resolved == NULL)
|
|
||||||
{
|
|
||||||
__set_errno (EINVAL);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return canonicalize (name, resolved);
|
|
||||||
}
|
|
||||||
weak_alias (__realpath, realpath)
|
weak_alias (__realpath, realpath)
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
__canonicalize_file_name (const char *name)
|
__canonicalize_file_name (const char *name)
|
||||||
{
|
{
|
||||||
return canonicalize (name, NULL);
|
return __realpath (name, NULL);
|
||||||
}
|
}
|
||||||
weak_alias (__canonicalize_file_name, canonicalize_file_name)
|
weak_alias (__canonicalize_file_name, canonicalize_file_name)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Test program for returning the canonical absolute name of a given file.
|
/* Test program for returning the canonical absolute name of a given file.
|
||||||
Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
|
Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by David Mosberger <davidm@azstarnet.com>.
|
Contributed by David Mosberger <davidm@azstarnet.com>.
|
||||||
|
|
||||||
@ -132,6 +132,8 @@ do_test (int argc, char ** argv)
|
|||||||
++errors;
|
++errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* This is now allowed. The test is invalid. */
|
||||||
errno = 0;
|
errno = 0;
|
||||||
if (realpath ("/", NULL) != NULL || errno != EINVAL)
|
if (realpath ("/", NULL) != NULL || errno != EINVAL)
|
||||||
{
|
{
|
||||||
@ -139,6 +141,7 @@ do_test (int argc, char ** argv)
|
|||||||
" for realpath(...,NULL)\n", argv[0]);
|
" for realpath(...,NULL)\n", argv[0]);
|
||||||
++errors;
|
++errors;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
if (realpath ("", buf) != NULL || errno != ENOENT)
|
if (realpath ("", buf) != NULL || errno != ENOENT)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1993, 1997, 1998 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1993, 1997, 1998, 2002 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -16,6 +16,7 @@
|
|||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#define SECS_PER_HOUR (60 * 60)
|
#define SECS_PER_HOUR (60 * 60)
|
||||||
@ -73,7 +74,11 @@ __offtime (t, offset, tp)
|
|||||||
}
|
}
|
||||||
tp->tm_year = y - 1900;
|
tp->tm_year = y - 1900;
|
||||||
if (tp->tm_year != y - 1900)
|
if (tp->tm_year != y - 1900)
|
||||||
return 0;
|
{
|
||||||
|
/* The year cannot be represented due to overflow. */
|
||||||
|
__set_errno (EOVERFLOW);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
tp->tm_yday = days;
|
tp->tm_yday = days;
|
||||||
ip = __mon_yday[__isleap(y)];
|
ip = __mon_yday[__isleap(y)];
|
||||||
for (y = 11; days < (long int) ip[y]; --y)
|
for (y = 11; days < (long int) ip[y]; --y)
|
||||||
|
Loading…
Reference in New Issue
Block a user