From bf4d3b763cae795e249f11ac2a516f72f7143319 Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Wed, 27 Sep 2006 11:54:54 +0000 Subject: [PATCH] - __get_default_file() called __fd_unlock() without having called __fd_lock() first. Ouch. - Removed an unnecessary pair of __fd_lock()..__fd_unlock() calls from ttyname_r(). git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15156 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- library/changes | 8 +++++++- library/fcntl_get_default_file.c | 4 ++-- library/unistd_ttyname_r.c | 6 +----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/library/changes b/library/changes index b3a1165..1f09ccc 100644 --- a/library/changes +++ b/library/changes @@ -1,4 +1,10 @@ -- Unlink is now reentrant, or at least thread-safe. +- __get_default_file() called __fd_unlock() without having called + __fd_lock() first. Ouch. + +- Removed an unnecessary pair of __fd_lock()..__fd_unlock() calls from + ttyname_r(). + +- The libunix.a unlink() function is now reentrant, or at least thread-safe. - You can now make unlink() stop after a failed deletion attempt which failed because the object to be deleted was reported as being "in use". diff --git a/library/fcntl_get_default_file.c b/library/fcntl_get_default_file.c index 2b81e8d..1f397c6 100644 --- a/library/fcntl_get_default_file.c +++ b/library/fcntl_get_default_file.c @@ -1,5 +1,5 @@ /* - * $Id: fcntl_get_default_file.c,v 1.6 2006-09-12 14:16:44 obarthel Exp $ + * $Id: fcntl_get_default_file.c,v 1.7 2006-09-27 11:54:54 obarthel Exp $ * * :ts=4 * @@ -60,7 +60,7 @@ __get_default_file(int file_descriptor,long * file_ptr) goto out; } - __fd_unlock(fd); + __fd_lock(fd); #if defined(__THREAD_SAFE) { diff --git a/library/unistd_ttyname_r.c b/library/unistd_ttyname_r.c index e50b191..1c1ef6b 100755 --- a/library/unistd_ttyname_r.c +++ b/library/unistd_ttyname_r.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_ttyname_r.c,v 1.4 2006-09-25 14:05:31 obarthel Exp $ + * $Id: unistd_ttyname_r.c,v 1.5 2006-09-27 11:54:54 obarthel Exp $ * * :ts=4 * @@ -111,12 +111,8 @@ ttyname_r(int file_descriptor,char *name,size_t buflen) break; } - __fd_lock(fd); - if(file != ZERO && IsInteractive(file)) is_tty = TRUE; - - __fd_unlock(fd); } else {