[6916] Fixed typos in spell checking code.
[getmangos.git] / dep / ACE_wrappers / ace / Handle_Ops.cpp
blob0ec856cf1c94a4a9cdb93b35d3dfb7f7919a2e78
1 // $Id: Handle_Ops.cpp 80826 2008-03-04 14:51:23Z wotte $
3 #include "ace/Handle_Ops.h"
5 #include "ace/OS_NS_errno.h"
6 #include "ace/OS_NS_fcntl.h"
7 #include "ace/Time_Value.h"
9 ACE_RCSID (ace,
10 Handle_Ops,
11 "$Id: Handle_Ops.cpp 80826 2008-03-04 14:51:23Z wotte $")
14 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
16 ACE_HANDLE
17 ACE::handle_timed_open (ACE_Time_Value *timeout,
18 const ACE_TCHAR *name,
19 int flags,
20 int perms,
21 LPSECURITY_ATTRIBUTES sa)
23 ACE_TRACE ("ACE::handle_timed_open");
25 if (timeout != 0)
27 #if !defined (ACE_WIN32)
28 // On Win32, ACE_NONBLOCK gets recognized as O_WRONLY so we
29 // don't use it there
30 flags |= ACE_NONBLOCK;
31 #endif /* ACE_WIN32 */
33 // Open the named pipe or file using non-blocking mode...
34 ACE_HANDLE const handle = ACE_OS::open (name, flags, perms, sa);
36 if (handle == ACE_INVALID_HANDLE
37 && (errno == EWOULDBLOCK
38 && (timeout->sec () > 0 || timeout->usec () > 0)))
39 // This expression checks if we were polling.
40 errno = ETIMEDOUT;
42 return handle;
44 else
45 return ACE_OS::open (name, flags, perms, sa);
48 ACE_END_VERSIONED_NAMESPACE_DECL