Restore build on FreeBSD.
[getmangos.git] / dep / ACE_wrappers / ace / SPIPE.cpp
blobcddd44e90045364351a3cbd4dba7958ee1554558
1 // $Id: SPIPE.cpp 80826 2008-03-04 14:51:23Z wotte $
3 #include "ace/SPIPE.h"
5 #include "ace/OS_NS_unistd.h"
7 #if !defined (__ACE_INLINE__)
8 #include "ace/SPIPE.inl"
9 #endif /* __ACE_INLINE__ */
11 ACE_RCSID(ace, SPIPE, "$Id: SPIPE.cpp 80826 2008-03-04 14:51:23Z wotte $")
13 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
15 ACE_ALLOC_HOOK_DEFINE(ACE_SPIPE)
17 // This is the do-nothing constructor.
19 ACE_SPIPE::ACE_SPIPE (void)
21 // ACE_TRACE ("ACE_SPIPE::ACE_SPIPE");
24 void
25 ACE_SPIPE::dump (void) const
27 #if defined (ACE_HAS_DUMP)
28 ACE_TRACE ("ACE_SPIPE::dump");
29 #endif /* ACE_HAS_DUMP */
32 // Close down a ACE_SPIPE.
34 int
35 ACE_SPIPE::get_local_addr (ACE_SPIPE_Addr &local_sap) const
37 ACE_TRACE ("ACE_SPIPE::get_local_addr");
38 local_sap = this->local_addr_;
39 return 0;
42 // Close down the STREAM pipe without removing the rendezvous point.
44 int
45 ACE_SPIPE::close (void)
47 ACE_TRACE ("ACE_SPIPE::close");
48 int result = 0;
50 if (this->get_handle () != ACE_INVALID_HANDLE)
52 result = ACE_OS::close (this->get_handle ());
53 #if defined (ACE_HAS_STREAM_PIPES)
54 result = (ACE_OS::close (duplex_pipe_handle_) || result);
55 #endif /* ACE_HAS_STREAM_PIPES */
56 this->set_handle (ACE_INVALID_HANDLE);
58 return result;
61 // Close down the STREAM pipe and remove the rendezvous point from the
62 // file system.
64 int
65 ACE_SPIPE::remove (void)
67 ACE_TRACE ("ACE_SPIPE::remove");
68 int result = this->close ();
69 return ACE_OS::unlink (this->local_addr_.get_path_name ()) == -1 || result == -1 ? -1 : 0;
72 #if defined (ACE_HAS_STREAM_PIPES)
73 /// Temporary store of duplex pipe handle.
74 void
75 ACE_SPIPE::set_duplex_handle (ACE_HANDLE handle)
77 ACE_TRACE ("ACE_SPIPE::set_duplex_handle");
78 this->duplex_pipe_handle_ = handle;
80 #endif /* ACE_HAS_STREAM_PIPES */
82 ACE_END_VERSIONED_NAMESPACE_DECL