diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-06-07 08:13:28 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-06-07 08:13:28 +0000 |
commit | 3279b757b8bcfbc783b8927b60c940aacd332e02 (patch) | |
tree | dacabed69662bb6443418177c1cf1b9fe5abb462 /examples/IPC_SAP | |
parent | fb40764fd1fa0255876e15f23e369fd19d34b1fd (diff) | |
download | ATCD-3279b757b8bcfbc783b8927b60c940aacd332e02.tar.gz |
.
Diffstat (limited to 'examples/IPC_SAP')
-rw-r--r-- | examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp b/examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp index 02dd75036d2..3e690a7bfdb 100644 --- a/examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp +++ b/examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp @@ -26,7 +26,7 @@ do_child (ACE_FIFO_Recv &fifo_reader) return -1; char *argv[2]; - argv[0] = EXEC_COMMAND_ARG; + argv[0] = (char *) EXEC_COMMAND_ARG; argv[1] = 0; if (ACE_OS::execvp (EXEC_NAME, argv) == -1) @@ -39,13 +39,14 @@ do_parent (const char fifo_name[], char input_filename[]) { ACE_FIFO_Send fifo_sender (fifo_name, O_WRONLY | O_CREAT); - int len; + ssize_t len; char buf[BUFSIZ]; if (fifo_sender.get_handle () == ACE_INVALID_HANDLE) return -1; - ACE_HANDLE inputfd = ACE_OS::open (input_filename, O_RDONLY); + ACE_HANDLE inputfd = + ACE_OS::open (input_filename, O_RDONLY); if (inputfd == ACE_INVALID_HANDLE) return -1; @@ -70,7 +71,9 @@ main (int argc, char *argv[]) ACE_LOG_MSG->open (argv[0]); if (argc != 2) - ACE_ERROR ((LM_ERROR, "usage: %n input-file\n%a", 1)); + ACE_ERROR ((LM_ERROR, + "usage: %n input-file\n%a", + 1)); ACE_FIFO_Recv fifo_reader (FIFO_NAME, O_RDONLY | O_CREAT, PERMS, 0); @@ -82,17 +85,29 @@ main (int argc, char *argv[]) switch (child_pid) { case -1: - ACE_ERROR ((LM_ERROR, "%n: %p\n%a", "fork", 1)); + ACE_ERROR ((LM_ERROR, + "%n: %p\n%a", + "fork", + 1)); case 0: if (do_child (fifo_reader) == -1) - ACE_ERROR ((LM_ERROR, "%n: %p\n%a", "do_child", 1)); + ACE_ERROR ((LM_ERROR, + "%n: %p\n%a", + "do_child", + 1)); default: if (do_parent (FIFO_NAME, argv[1]) == -1) - ACE_ERROR ((LM_ERROR, "%n: %p\n%a", "do_parent", 1)); + ACE_ERROR ((LM_ERROR, + "%n: %p\n%a", + "do_parent", + 1)); // wait for child to ACE_OS::exit. if (ACE_OS::waitpid (child_pid, (int *) 0, 0) == -1) - ACE_ERROR ((LM_ERROR, "%n: %p\n%a", "waitpid", 1)); + ACE_ERROR ((LM_ERROR, + "%n: %p\n%a", + "waitpid", + 1)); } return 0; |