summaryrefslogtreecommitdiff
path: root/ACE/examples
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2007-07-03 21:07:53 +0000
committerSteve Huston <shuston@riverace.com>2007-07-03 21:07:53 +0000
commit033524440e21243fe1836a99c3253c3febbff7cd (patch)
tree99d379a36fffc9f002d26e6141d6e147990e29dc /ACE/examples
parentbfc275ce9650ac4c5aebcc9b7301a1f970654d9c (diff)
downloadATCD-033524440e21243fe1836a99c3253c3febbff7cd.tar.gz
ChangeLogTag:Tue Jul 3 21:04:59 UTC 2007 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/examples')
-rw-r--r--ACE/examples/APG/Sockets/Basic.cpp3
-rw-r--r--ACE/examples/APG/Sockets/Iovec.cpp5
-rw-r--r--ACE/examples/Connection/misc/test_upipe.h2
-rw-r--r--ACE/examples/IPC_SAP/SOCK_SAP/sock_sap.mpc1
-rw-r--r--ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.mpc1
-rw-r--r--ACE/examples/OS/Process/OS_Process.mpc1
-rw-r--r--ACE/examples/Reactor/Misc/notification.cpp4
-rw-r--r--ACE/examples/Reactor/Misc/test_demuxing.cpp7
-rw-r--r--ACE/examples/Reactor/Multicast/Log_Wrapper.cpp3
9 files changed, 20 insertions, 7 deletions
diff --git a/ACE/examples/APG/Sockets/Basic.cpp b/ACE/examples/APG/Sockets/Basic.cpp
index 6a20e435b3c..ee637332b78 100644
--- a/ACE/examples/APG/Sockets/Basic.cpp
+++ b/ACE/examples/APG/Sockets/Basic.cpp
@@ -4,6 +4,7 @@
#include "ace/SOCK_Stream.h"
#include "ace/SOCK_Connector.h"
#include "ace/Log_Msg.h"
+#include "ace/OS_NS_unistd.h"
int ACE_TMAIN (int, ACE_TCHAR *[])
{
@@ -27,7 +28,7 @@ int ACE_TMAIN (int, ACE_TCHAR *[])
// Listing 3 code/ch06
peer.send_n ("uptime\n", 7);
bc = peer.recv (buf, sizeof(buf));
- write (1, buf, bc);
+ ACE_OS::write (ACE_STDOUT, buf, bc);
peer.close ();
// Listing 3
diff --git a/ACE/examples/APG/Sockets/Iovec.cpp b/ACE/examples/APG/Sockets/Iovec.cpp
index fb27b6d562e..1919ac8f4cf 100644
--- a/ACE/examples/APG/Sockets/Iovec.cpp
+++ b/ACE/examples/APG/Sockets/Iovec.cpp
@@ -4,6 +4,7 @@
#include "ace/SOCK_Stream.h"
#include "ace/SOCK_Connector.h"
#include "ace/Log_Msg.h"
+#include "ace/OS_NS_unistd.h"
const char *UPTIME = "uptime";
const char *HUMIDITY = "humidity";
@@ -63,7 +64,7 @@ int ACE_TMAIN (int, ACE_TCHAR *[])
size_t wc = receive[i].iov_len;
if (static_cast<size_t> (bc) < wc)
wc = static_cast<size_t> (bc);
- write (1, receive[i].iov_base, wc);
+ ACE_OS::write (ACE_STDOUT, receive[i].iov_base, wc);
bc -= receive[i].iov_len;
delete []
(reinterpret_cast<char *> (receive[i].iov_base));
@@ -74,7 +75,7 @@ int ACE_TMAIN (int, ACE_TCHAR *[])
peer.send_n ("uptime\n", 7);
iovec response;
peer.recvv (&response);
- write (1, response.iov_base, response.iov_len);
+ ACE_OS::write (ACE_STDOUT, response.iov_base, response.iov_len);
delete [] reinterpret_cast<char *> (response.iov_base);
// Listing 5
diff --git a/ACE/examples/Connection/misc/test_upipe.h b/ACE/examples/Connection/misc/test_upipe.h
index 89349760e9c..04c79909f13 100644
--- a/ACE/examples/Connection/misc/test_upipe.h
+++ b/ACE/examples/Connection/misc/test_upipe.h
@@ -34,7 +34,7 @@ public:
ssize_t n;
while ((n = this->peer ().recv (buf, sizeof buf)) > 0)
- ::write (1, buf, n);
+ ACE_OS::write (ACE_STDOUT, buf, n);
return 0;
}
diff --git a/ACE/examples/IPC_SAP/SOCK_SAP/sock_sap.mpc b/ACE/examples/IPC_SAP/SOCK_SAP/sock_sap.mpc
index 814280a515c..e2081ed7652 100644
--- a/ACE/examples/IPC_SAP/SOCK_SAP/sock_sap.mpc
+++ b/ACE/examples/IPC_SAP/SOCK_SAP/sock_sap.mpc
@@ -9,6 +9,7 @@ project(*C_inclient) : aceexe {
}
project(*C_inserver) : aceexe {
+ avoids += wince
exename = C-inserver
Source_Files {
C-inserver.cpp
diff --git a/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.mpc b/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.mpc
index fea7e91ec9f..b9dd3dfacc8 100644
--- a/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.mpc
+++ b/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.mpc
@@ -2,6 +2,7 @@
// $Id$
project : aceexe, ace_mfc {
+ avoids += wince
exename = Log_Msg_MFC
Source_Files {
Log_Msg_MFC.cpp
diff --git a/ACE/examples/OS/Process/OS_Process.mpc b/ACE/examples/OS/Process/OS_Process.mpc
index 082f7133301..ea2e08ec454 100644
--- a/ACE/examples/OS/Process/OS_Process.mpc
+++ b/ACE/examples/OS/Process/OS_Process.mpc
@@ -9,6 +9,7 @@ project(*imore) : aceexe {
}
}
project(*process) : aceexe {
+ avoids += wince
exename = process
Source_Files {
process.cpp
diff --git a/ACE/examples/Reactor/Misc/notification.cpp b/ACE/examples/Reactor/Misc/notification.cpp
index 067012837ff..cf790ff6b03 100644
--- a/ACE/examples/Reactor/Misc/notification.cpp
+++ b/ACE/examples/Reactor/Misc/notification.cpp
@@ -278,7 +278,11 @@ Thread_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *)
switch (signum)
{
case SIGINT:
+ // This is coded thusly to avoid problems if SIGQUIT is a legit
+ // value but is not a preprocessor macro.
+#if !defined (SIGQUIT) || (SIGQUIT != 0)
case SIGQUIT:
+#endif
ACE_ERROR ((LM_ERROR,
"(%t) ******************** shutting down %n on signal %S\n",
signum));
diff --git a/ACE/examples/Reactor/Misc/test_demuxing.cpp b/ACE/examples/Reactor/Misc/test_demuxing.cpp
index ab550ca715f..4bc6d340560 100644
--- a/ACE/examples/Reactor/Misc/test_demuxing.cpp
+++ b/ACE/examples/Reactor/Misc/test_demuxing.cpp
@@ -141,9 +141,12 @@ Sig_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *)
(this->handle_,
ACE_Event_Handler::READ_MASK,
ACE_Reactor::ADD_MASK);
-#if defined (ACE_WIN32)
+#if defined (ACE_WIN32) && defined (SIGTERM)
case SIGTERM:
-#else
+
+ // This is coded thusly to avoid problems if SIGQUIT is a legit
+ // value but is not a preprocessor macro.
+#elif !defined (SIGQUIT) || (SIGQUIT != 0)
case SIGQUIT:
#endif /* ACE_WIN32 */
ACE_Reactor::end_event_loop ();
diff --git a/ACE/examples/Reactor/Multicast/Log_Wrapper.cpp b/ACE/examples/Reactor/Multicast/Log_Wrapper.cpp
index e2622b08561..f297b3ff2fd 100644
--- a/ACE/examples/Reactor/Multicast/Log_Wrapper.cpp
+++ b/ACE/examples/Reactor/Multicast/Log_Wrapper.cpp
@@ -8,6 +8,7 @@
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_netdb.h"
#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_time.h"
ACE_RCSID(Multicast, Log_Wrapper, "$Id$")
@@ -66,7 +67,7 @@ Log_Wrapper::log_message (Log_Priority type, char *message)
this->log_msg_.type = type;
// Casting time() to long will start causing bad results sometime in 2038
// but the receiver isn't looking at the time, so who cares?
- this->log_msg_.time = (long) time (0);
+ this->log_msg_.time = (long) ACE_OS::time (0);
this->log_msg_.msg_length = ACE_OS::strlen(message)+1;
this->log_msg_.sequence_number = ACE_HTONL(sequence_number_);