mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
Update.
* io/test-lfs.c (do_prepare): Rewrite so it doesn't fail on systems without LFS support.
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
2000-10-25 Ulrich Drepper <drepper@redhat.com>
|
2000-10-25 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* io/test-lfs.c (do_prepare): Rewrite so it doesn't fail on systems
|
||||||
|
without LFS support.
|
||||||
|
|
||||||
* sysdeps/ieee754/dbl-64/e_jn.c: Use __ieee754_sqrt instead of __sqrt.
|
* sysdeps/ieee754/dbl-64/e_jn.c: Use __ieee754_sqrt instead of __sqrt.
|
||||||
* sysdeps/ieee754/dbl-64/e_j1.c: Likewise.
|
* sysdeps/ieee754/dbl-64/e_j1.c: Likewise.
|
||||||
* sysdeps/ieee754/dbl-64/e_j0.c: Likewise.
|
* sysdeps/ieee754/dbl-64/e_j0.c: Likewise.
|
||||||
|
@@ -50,6 +50,7 @@ void
|
|||||||
do_prepare (int argc, char *argv[])
|
do_prepare (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char name_len;
|
char name_len;
|
||||||
|
struct rlimit64 rlim;
|
||||||
|
|
||||||
name_len = strlen (test_dir);
|
name_len = strlen (test_dir);
|
||||||
name = malloc (name_len + sizeof ("/lfsXXXXXX"));
|
name = malloc (name_len + sizeof ("/lfsXXXXXX"));
|
||||||
@@ -58,24 +59,33 @@ do_prepare (int argc, char *argv[])
|
|||||||
add_temp_file (name);
|
add_temp_file (name);
|
||||||
|
|
||||||
/* Open our test file. */
|
/* Open our test file. */
|
||||||
if (mktemp (name) == NULL)
|
fd = mkstemp64 (name);
|
||||||
error (EXIT_FAILURE, errno, "cannot create temporary file name");
|
if (fd == -1)
|
||||||
|
{
|
||||||
fd = open64 (name, O_CREAT|O_TRUNC|O_RDWR, 0666);
|
if (errno == ENOSYS)
|
||||||
if (fd == -1 && errno == ENOSYS)
|
|
||||||
{
|
{
|
||||||
/* Fail silently. */
|
/* Fail silently. */
|
||||||
error (0, errno, "open64 is not supported");
|
error (0, errno, "open64 is not supported");
|
||||||
exit (EXIT_SUCCESS);
|
exit (EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
error (EXIT_FAILURE, errno, "cannot create temporary file");
|
||||||
|
}
|
||||||
|
|
||||||
if (fd == -1)
|
if (getrlimit64 (RLIMIT_FSIZE, &rlim) != 0)
|
||||||
error (EXIT_FAILURE, errno, "cannot open test file `%s'", name);
|
{
|
||||||
|
error (0, errno, "cannot get resource limit");
|
||||||
if (setrlimit64 (RLIMIT_FSIZE, &((const struct rlimit64)
|
exit (0);
|
||||||
{ RLIM_INFINITY, RLIM_INFINITY }))
|
}
|
||||||
== -1)
|
if (rlim.rlim_cur < TWO_GB + 200)
|
||||||
error (EXIT_FAILURE, errno, "cannot reset file size limits");
|
{
|
||||||
|
rlim.rlim_cur = TWO_GB + 200;
|
||||||
|
if (setrlimit64 (RLIMIT_FSIZE, &rlim) != 0)
|
||||||
|
{
|
||||||
|
error (0, errno, "cannot reset file size limits");
|
||||||
|
exit (0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Reference in New Issue
Block a user