mirror of
https://sourceware.org/git/glibc.git
synced 2025-04-21 23:06:08 +03:00
Update.
2003-02-24 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r): Remove EACCES test.
This commit is contained in:
parent
8637130890
commit
80d807799f
@ -1,3 +1,8 @@
|
|||||||
|
2003-02-24 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r): Remove EACCES
|
||||||
|
test.
|
||||||
|
|
||||||
2003-02-24 Roland McGrath <roland@redhat.com>
|
2003-02-24 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
* sysdeps/posix/pause.c: Add LIBC_CANCEL_HANDLED.
|
* sysdeps/posix/pause.c: Add LIBC_CANCEL_HANDLED.
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
2003-02-24 Ulrich Drepper <drepper@redhat.com>
|
2003-02-24 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* tst-cond2.c: Fix sychronization with child.
|
||||||
|
|
||||||
* tst-rwlock8.c (reader_thread): Remove unused variable.
|
* tst-rwlock8.c (reader_thread): Remove unused variable.
|
||||||
|
|
||||||
* Makefile: Add rules to build and run tst-tls3.
|
* Makefile: Add rules to build and run tst-tls3.
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
static pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;
|
||||||
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
|
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
|
||||||
|
|
||||||
static pthread_mutex_t syncm = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_barrier_t bar;
|
||||||
|
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
@ -41,11 +41,14 @@ tf (void *a)
|
|||||||
if (err != 0)
|
if (err != 0)
|
||||||
error (EXIT_FAILURE, err, "locking in child failed");
|
error (EXIT_FAILURE, err, "locking in child failed");
|
||||||
|
|
||||||
printf ("child %d: unlock sync\n", i);
|
printf ("child %d: sync\n", i);
|
||||||
|
|
||||||
err = pthread_mutex_unlock (&syncm);
|
int e = pthread_barrier_wait (&bar);
|
||||||
if (err != 0)
|
if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
|
||||||
error (EXIT_FAILURE, err, "child %d: unlock[1] failed", i);
|
{
|
||||||
|
puts ("child: barrier_wait failed");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
printf ("child %d: wait\n", i);
|
printf ("child %d: wait\n", i);
|
||||||
|
|
||||||
@ -77,11 +80,11 @@ do_test (void)
|
|||||||
|
|
||||||
printf ("&cond = %p\n&mut = %p\n", &cond, &mut);
|
printf ("&cond = %p\n&mut = %p\n", &cond, &mut);
|
||||||
|
|
||||||
puts ("first lock");
|
if (pthread_barrier_init (&bar, NULL, 2) != 0)
|
||||||
|
{
|
||||||
err = pthread_mutex_lock (&syncm);
|
puts ("barrier_init failed");
|
||||||
if (err != 0)
|
exit (1);
|
||||||
error (EXIT_FAILURE, err, "initial locking failed");
|
}
|
||||||
|
|
||||||
for (i = 0; i < N; ++i)
|
for (i = 0; i < N; ++i)
|
||||||
{
|
{
|
||||||
@ -93,12 +96,14 @@ do_test (void)
|
|||||||
|
|
||||||
printf ("wait for child %d\n", i);
|
printf ("wait for child %d\n", i);
|
||||||
|
|
||||||
/* Lock and thereby wait for the child to start up and get the
|
/* Wait for the child to start up and get the mutex for the
|
||||||
mutex for the conditional variable. */
|
conditional variable. */
|
||||||
pthread_mutex_lock (&syncm);
|
int e = pthread_barrier_wait (&bar);
|
||||||
/* Unlock right away. Yes, we can use barriers but then we
|
if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
|
||||||
would test more functionality here. */
|
{
|
||||||
pthread_mutex_unlock (&syncm);
|
puts ("barrier_wait failed");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
puts ("get lock outselves");
|
puts ("get lock outselves");
|
||||||
|
@ -124,8 +124,6 @@ __ttyname_r (int fd, char *buf, size_t buflen)
|
|||||||
__set_errno (EBADF);
|
__set_errno (EBADF);
|
||||||
return EBADF;
|
return EBADF;
|
||||||
}
|
}
|
||||||
if (ret == -1 && errno == EACCES)
|
|
||||||
return EACCES;
|
|
||||||
|
|
||||||
if (!__isatty (fd))
|
if (!__isatty (fd))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user