summaryrefslogtreecommitdiff
path: root/ACE/ace/OS_NS_Thread.inl
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2009-01-29 10:34:33 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2009-01-29 10:34:33 +0000
commitee2d2daa6485ca044eb6012228ad03a7c9e5a0af (patch)
tree0276d27cc537c068569300c6b3ff30971dc4c00a /ACE/ace/OS_NS_Thread.inl
parent37af52e11cf290cb5153dd957bd55ae395968e0a (diff)
downloadATCD-ee2d2daa6485ca044eb6012228ad03a7c9e5a0af.tar.gz
Thu Jan 29 10:33:52 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/ATM_Acceptor.cpp: * ace/ATM_QoS.cpp: * ace/ATM_Stream.cpp: * ace/ATM_Stream.inl: * ace/OS_NS_Thread.inl: * ace/OS_NS_unistd.inl: * ace/OS_NS_wchar.cpp: Don't use () when returning 0 or -1
Diffstat (limited to 'ACE/ace/OS_NS_Thread.inl')
-rw-r--r--ACE/ace/OS_NS_Thread.inl30
1 files changed, 15 insertions, 15 deletions
diff --git a/ACE/ace/OS_NS_Thread.inl b/ACE/ace/OS_NS_Thread.inl
index fca22852c23..27a722b7236 100644
--- a/ACE/ace/OS_NS_Thread.inl
+++ b/ACE/ace/OS_NS_Thread.inl
@@ -1572,15 +1572,15 @@ ACE_OS::sema_init (ACE_sema_t *s,
if ((s->fd_[0] = ACE_OS::open (name, O_RDONLY | O_NONBLOCK)) == ACE_INVALID_HANDLE
|| (s->fd_[1] = ACE_OS::open (name, O_WRONLY | O_NONBLOCK)) == ACE_INVALID_HANDLE)
- return (-1);
+ return -1;
/* turn off nonblocking for fd_[0] */
if ((flags = ACE_OS::fcntl (s->fd_[0], F_GETFL, 0)) < 0)
- return (-1);
+ return -1;
flags &= ~O_NONBLOCK;
if (ACE_OS::fcntl (s->fd_[0], F_SETFL, flags) < 0)
- return (-1);
+ return -1;
//if (s->name_ && count)
if (creator && count)
@@ -1588,7 +1588,7 @@ ACE_OS::sema_init (ACE_sema_t *s,
char c = 1;
for (u_int i=0; i<count ;++i)
if (ACE_OS::write (s->fd_[1], &c, sizeof (char)) != 1)
- return (-1);
+ return -1;
}
// In the case of process scope semaphores we can already unlink the FIFO now that
@@ -1602,7 +1602,7 @@ ACE_OS::sema_init (ACE_sema_t *s,
ACE_OS::unlink (name);
}
- return (0);
+ return 0;
#elif defined (ACE_HAS_THREADS)
# if defined (ACE_HAS_STHREADS)
ACE_UNUSED_ARG (name);
@@ -1800,8 +1800,8 @@ ACE_OS::sema_post (ACE_sema_t *s)
# elif defined (ACE_USES_FIFO_SEM)
char c = 1;
if (ACE_OS::write (s->fd_[1], &c, sizeof (char)) == sizeof (char))
- return (0);
- return (-1);
+ return 0;
+ return -1;
# elif defined (ACE_HAS_THREADS)
# if defined (ACE_HAS_STHREADS)
int result;
@@ -1890,10 +1890,10 @@ ACE_OS::sema_trywait (ACE_sema_t *s)
/* turn on nonblocking for s->fd_[0] */
if ((flags = ACE_OS::fcntl (s->fd_[0], F_GETFL, 0)) < 0)
- return (-1);
+ return -1;
flags |= O_NONBLOCK;
if (ACE_OS::fcntl (s->fd_[0], F_SETFL, flags) < 0)
- return (-1);
+ return -1;
// read sets errno to EAGAIN if no input
rc = ACE_OS::read (s->fd_[0], &c, sizeof (char));
@@ -2010,8 +2010,8 @@ ACE_OS::sema_wait (ACE_sema_t *s)
# elif defined (ACE_USES_FIFO_SEM)
char c;
if (ACE_OS::read (s->fd_[0], &c, sizeof (char)) == 1)
- return (0);
- return (-1);
+ return 0;
+ return -1;
# elif defined (ACE_HAS_THREADS)
# if defined (ACE_HAS_STHREADS)
int result;
@@ -2193,13 +2193,13 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
{
if (rc == 0)
errno = ETIME;
- return (-1);
+ return -1;
}
}
// try to read the signal *but* do *not* block
if (rc == 1 && ACE_OS::sema_trywait (s) == 0)
- return (0);
+ return 0;
// we were woken for input but someone beat us to it
// so we wait again if there is still time
@@ -2209,7 +2209,7 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv)
// make sure errno is set right
errno = ETIME;
- return (-1);
+ return -1;
# elif defined (ACE_HAS_THREADS)
# if defined (ACE_HAS_STHREADS)
ACE_UNUSED_ARG (s);
@@ -3111,7 +3111,7 @@ ACE_OS::thr_setprio (ACE_hthread_t ht_id, int priority, int policy)
ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::SetThreadPriority (ht_id, priority),
ace_result_),
int, -1);
-# else
+# else
ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::CeSetThreadPriority (ht_id, priority),
ace_result_),
int, -1);