summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-03-17 21:04:22 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-03-17 21:04:22 +0000
commitbd2f1beb68e9a38a2166c69cb2dedf8190fb6dc6 (patch)
tree92fdff7feda54ce3b89e59da88cddd58144ed463
parent0f44daa6e5a3f3cac55802f154eddc9fb02f10f7 (diff)
downloadATCD-bd2f1beb68e9a38a2166c69cb2dedf8190fb6dc6.tar.gz
LM_ERROR instead of ACE_ERROR, and fixed call to ACE::basename ()
-rw-r--r--examples/Mem_Map/IO-tests/test_io.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/examples/Mem_Map/IO-tests/test_io.cpp b/examples/Mem_Map/IO-tests/test_io.cpp
index 5e3ad676928..e9ba03fb394 100644
--- a/examples/Mem_Map/IO-tests/test_io.cpp
+++ b/examples/Mem_Map/IO-tests/test_io.cpp
@@ -9,7 +9,7 @@
#include "IO_Test.h"
// Name of program.
-static char *program_name;
+static const char *program_name;
// Name of default input file.
static char *input_filename = "/usr/dict/words";
@@ -99,7 +99,7 @@ run_tests (int iterations, FILE *input_fp, FILE *output_fp)
for (i = 0; test_vector[i] != 0; i++)
{
if (ACE_OS::ftruncate (fileno (output_fp), 0) == -1)
- ACE_ERROR_RETURN ((ACE_ERROR, "%s\n", "ftruncate"));
+ ACE_ERROR ((LM_ERROR, "%s\n", "ftruncate"));
cerr << "--------------------\n"
<< "starting " << test_vector[i]->name () << " for " << iterations
@@ -123,7 +123,12 @@ run_tests (int iterations, FILE *input_fp, FILE *output_fp)
int
main (int argc, char *argv[])
{
- program_name = ACE::basename (argv[0]);
+#if defined (ACE_WIN32)
+ char delim = '\\';
+#else
+ char delim = '/';
+#endif /* ACE_WIN32 */
+ program_name = ACE::basename (argv[0], delim);
parse_args (argc, argv);
ACE_Sig_Action sa ((ACE_SignalHandler) cleanup, SIGINT);
@@ -133,10 +138,10 @@ main (int argc, char *argv[])
FILE *output_fp = ACE_OS::fopen (output_filename, "w+");
if (input_fp == 0)
- ACE_ERROR_RETURN ((ACE_ERROR, "%s\n", "input_filename"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR, "%s\n", "input_filename"), -1);
if (output_fp == 0)
- ACE_ERROR_RETURN ((ACE_ERROR, "%s\n", "output_filename"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR, "%s\n", "output_filename"), -1);
ACE_OS::unlink (output_filename);
@@ -144,7 +149,7 @@ main (int argc, char *argv[])
if (ACE_OS::fclose (input_fp) == -1
|| ACE_OS::fclose (output_fp) == -1)
- ACE_ERROR_RETURN ((ACE_ERROR, "%s\n", "fclose"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR, "%s\n", "fclose"), -1);
cleanup ();
return 0;