From ee556fcb35f954249120122ac51f366b69b9213c Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Wed, 9 Mar 2005 12:06:10 +0000 Subject: [PATCH] - Moved a few __delete_semaphore() calls into conditional compilation sections where they should have been in the first place. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14869 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- library/changes | 3 +++ library/socket_accept.c | 8 ++++++-- library/socket_hook_entry.c | 10 +++++++--- library/socket_init_exit.c | 8 ++++++-- library/socket_socket.c | 8 ++++++-- library/stdio_fclose.c | 10 +++++++--- library/stdio_fdhookentry.c | 10 +++++++--- 7 files changed, 42 insertions(+), 15 deletions(-) diff --git a/library/changes b/library/changes index a9d9f71..2685281 100644 --- a/library/changes +++ b/library/changes @@ -37,6 +37,9 @@ socket_data.c, dirent_data.c and stdio_data.c and into the code that initializes them. +- Moved a few __delete_semaphore() calls into conditional compilation + sections where they should have been in the first place. + c.lib 1.189 (5.3.2005) diff --git a/library/socket_accept.c b/library/socket_accept.c index 51f9419..8bdbd64 100644 --- a/library/socket_accept.c +++ b/library/socket_accept.c @@ -1,5 +1,5 @@ /* - * $Id: socket_accept.c,v 1.9 2005-03-04 09:07:09 obarthel Exp $ + * $Id: socket_accept.c,v 1.10 2005-03-09 12:06:10 obarthel Exp $ * * :ts=4 * @@ -139,7 +139,11 @@ accept(int sockfd,struct sockaddr *cliaddr,int *addrlen) __stdio_unlock(); - __delete_semaphore(lock); + #if defined(__THREAD_SAFE) + { + __delete_semaphore(lock); + } + #endif /* __THREAD_SAFE */ if(__check_abort_enabled) __check_abort(); diff --git a/library/socket_hook_entry.c b/library/socket_hook_entry.c index 7e729b1..ba048a5 100644 --- a/library/socket_hook_entry.c +++ b/library/socket_hook_entry.c @@ -1,5 +1,5 @@ /* - * $Id: socket_hook_entry.c,v 1.11 2005-03-03 14:20:55 obarthel Exp $ + * $Id: socket_hook_entry.c,v 1.12 2005-03-09 12:06:10 obarthel Exp $ * * :ts=4 * @@ -124,8 +124,12 @@ __socket_hook_entry( __fd_unlock(fd); - /* Free the lock semaphore now. */ - __delete_semaphore(fd->fd_Lock); + #if defined(__THREAD_SAFE) + { + /* Free the lock semaphore now. */ + __delete_semaphore(fd->fd_Lock); + } + #endif /* __THREAD_SAFE */ /* And that's the last for this file descriptor. */ memset(fd,0,sizeof(*fd)); diff --git a/library/socket_init_exit.c b/library/socket_init_exit.c index 49f3ec2..3b472d8 100644 --- a/library/socket_init_exit.c +++ b/library/socket_init_exit.c @@ -1,5 +1,5 @@ /* - * $Id: socket_init_exit.c,v 1.14 2005-03-09 10:48:59 obarthel Exp $ + * $Id: socket_init_exit.c,v 1.15 2005-03-09 12:06:10 obarthel Exp $ * * :ts=4 * @@ -322,7 +322,11 @@ __socket_init(void) { SHOWMSG("could not duplicate daemon socket"); - __delete_semaphore(lock); + #if defined(__THREAD_SAFE) + { + __delete_semaphore(lock); + } + #endif /* __THREAD_SAFE */ __show_error("Network server streams could not be initialized."); goto out; diff --git a/library/socket_socket.c b/library/socket_socket.c index c79200c..1908824 100644 --- a/library/socket_socket.c +++ b/library/socket_socket.c @@ -1,5 +1,5 @@ /* - * $Id: socket_socket.c,v 1.7 2005-03-04 09:07:09 obarthel Exp $ + * $Id: socket_socket.c,v 1.8 2005-03-09 12:06:10 obarthel Exp $ * * :ts=4 * @@ -104,7 +104,11 @@ socket(int domain,int type,int protocol) __stdio_unlock(); - __delete_semaphore(lock); + #if defined(__THREAD_SAFE) + { + __delete_semaphore(lock); + } + #endif /* __THREAD_SAFE */ if(__check_abort_enabled) __check_abort(); diff --git a/library/stdio_fclose.c b/library/stdio_fclose.c index 1111bf8..a17d668 100644 --- a/library/stdio_fclose.c +++ b/library/stdio_fclose.c @@ -1,5 +1,5 @@ /* - * $Id: stdio_fclose.c,v 1.8 2005-03-03 14:20:55 obarthel Exp $ + * $Id: stdio_fclose.c,v 1.9 2005-03-09 12:06:10 obarthel Exp $ * * :ts=4 * @@ -139,8 +139,12 @@ fclose(FILE *stream) if(file->iob_CustomBuffer != NULL) free(file->iob_CustomBuffer); - /* Free the lock semaphore now. */ - __delete_semaphore(file->iob_Lock); + #if defined(__THREAD_SAFE) + { + /* Free the lock semaphore now. */ + __delete_semaphore(file->iob_Lock); + } + #endif /* __THREAD_SAFE */ memset(file,0,sizeof(*file)); diff --git a/library/stdio_fdhookentry.c b/library/stdio_fdhookentry.c index 0ca9b46..2411a22 100644 --- a/library/stdio_fdhookentry.c +++ b/library/stdio_fdhookentry.c @@ -1,5 +1,5 @@ /* - * $Id: stdio_fdhookentry.c,v 1.18 2005-03-07 11:58:49 obarthel Exp $ + * $Id: stdio_fdhookentry.c,v 1.19 2005-03-09 12:06:10 obarthel Exp $ * * :ts=4 * @@ -341,8 +341,12 @@ __fd_hook_entry( __fd_unlock(fd); - /* Free the lock semaphore now. */ - __delete_semaphore(fd->fd_Lock); + #if defined(__THREAD_SAFE) + { + /* Free the lock semaphore now. */ + __delete_semaphore(fd->fd_Lock); + } + #endif /* __THREAD_SAFE */ /* And that's the last for this file descriptor. */ memset(fd,0,sizeof(*fd));