mirror of git://sourceware.org/git/glibc.git
Update.
2004-10-01 Ulrich Drepper <drepper@redhat.com> * posix/bug-glob1.c (prepare): Fix creation of symlink.
This commit is contained in:
parent
7b87aca68f
commit
cb984ef2a2
|
|
@ -1,3 +1,7 @@
|
||||||
|
2004-10-01 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* posix/bug-glob1.c (prepare): Fix creation of symlink.
|
||||||
|
|
||||||
2004-09-30 Ulrich Drepper <drepper@redhat.com>
|
2004-09-30 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* posix/Makefile: Add rules to build and run bug-glob1.
|
* posix/Makefile: Add rules to build and run bug-glob1.
|
||||||
|
|
|
||||||
|
|
@ -26,15 +26,21 @@ prepare (int argc, char *argv[])
|
||||||
|
|
||||||
size_t len = strlen (argv[1]);
|
size_t len = strlen (argv[1]);
|
||||||
static const char ext[] = "globXXXXXX";
|
static const char ext[] = "globXXXXXX";
|
||||||
fname = malloc (len + 1 + sizeof (ext));
|
fname = malloc (len + sizeof (ext));
|
||||||
if (fname == NULL)
|
if (fname == NULL)
|
||||||
error (EXIT_FAILURE, errno, "cannot create temp file");
|
error (EXIT_FAILURE, errno, "cannot create temp file");
|
||||||
strcpy (stpcpy (stpcpy (fname, argv[1]), "/"), ext);
|
again:
|
||||||
|
strcpy (stpcpy (fname, argv[1]), ext);
|
||||||
fname = mktemp (fname);
|
fname = mktemp (fname);
|
||||||
if (fname == NULL || *fname == '\0')
|
if (fname == NULL || *fname == '\0')
|
||||||
error (EXIT_FAILURE, errno, "cannot create temp file name");
|
error (EXIT_FAILURE, errno, "cannot create temp file name");
|
||||||
if (symlink ("bug-glob1-does-not-exist", fname) != 0)
|
if (symlink ("bug-glob1-does-not-exist", fname) != 0)
|
||||||
error (EXIT_FAILURE, errno, "cannot create symlink");
|
{
|
||||||
|
if (errno == EEXIST)
|
||||||
|
goto again;
|
||||||
|
|
||||||
|
error (EXIT_FAILURE, errno, "cannot create symlink");
|
||||||
|
}
|
||||||
add_temp_file (fname);
|
add_temp_file (fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue