diff options
author | Steve Huston <shuston@riverace.com> | 2012-03-28 22:06:20 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2012-03-28 22:06:20 +0000 |
commit | 3eb9eac54e49201adaffd411676eb3028ad46960 (patch) | |
tree | deb22cf834371bfd2603013d8482b7d86fcc9734 | |
parent | 54e25c35a91b41ecf6853517d34a7e3dbaec9547 (diff) | |
download | ATCD-3eb9eac54e49201adaffd411676eb3028ad46960.tar.gz |
ChangeLogTag:Wed Mar 28 22:03:45 UTC 2012 Steve Huston <shuston@riverace.com>
-rw-r--r-- | ACE/ChangeLog | 6 | ||||
-rw-r--r-- | ACE/examples/C++NPv1/Process_Per_Connection_Logging_Server.cpp | 16 |
2 files changed, 17 insertions, 5 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index bc5c96f8cdb..2f047e19a76 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,9 @@ +Wed Mar 28 22:03:45 UTC 2012 Steve Huston <shuston@riverace.com> + + * examples/C++NPv1/Process_Per_Connection_Logging_Server.cpp: Changed + the +H handle value scan to know this is a hex value on Windows, but + a decimal value on everything else. Thanks to Andy Gokhale for this. + Wed Mar 28 21:44:20 UTC 2012 Steve Huston <shuston@riverace.com> * tests/Multicast_Test.cpp: Removed the forced set_nic to "lo" for diff --git a/ACE/examples/C++NPv1/Process_Per_Connection_Logging_Server.cpp b/ACE/examples/C++NPv1/Process_Per_Connection_Logging_Server.cpp index 4b831dc4791..719ca0b23f7 100644 --- a/ACE/examples/C++NPv1/Process_Per_Connection_Logging_Server.cpp +++ b/ACE/examples/C++NPv1/Process_Per_Connection_Logging_Server.cpp @@ -146,15 +146,21 @@ Process_Per_Connection_Logging_Server::run_master (int argc, char *argv[]) int Process_Per_Connection_Logging_Server::run_worker (int, char *argv[]) { - intptr_t client_handle_i = ACE_OS::atoi (argv[2]); - // Some compilers don't like reinterpret_casting an int to an int, so - // only do reinterpret_cast on Windows. + // The handle value is passed as a hex pointer value on Windows and a + // decimal number everywhere else. See ace/Process.cpp for info. #if defined (ACE_WIN32) + intptr_t client_handle_i = 0; +# if defined (ACE_WIN64) + const char *fmt = "%I64x"; +# else + const char *fmt = "%x"; +# endif /* ACE_WIN64 */ + if (::sscanf_s (argv[2], fmt, &client_handle_i) == 0) + return -1; ACE_HANDLE client_handle = reinterpret_cast<ACE_HANDLE> (client_handle_i); #else - ACE_HANDLE client_handle = - static_cast<ACE_HANDLE> (client_handle_i); + ACE_HANDLE client_handle = static_cast<ACE_HANDLE> (ACE_OS::atoi (argv[2])); #endif /* ACE_WIN32 */ ACE_SOCK_Stream client (client_handle); |