summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Deao2013-08-21 15:34:01 -0500
committerDoug Deao2013-08-21 15:34:01 -0500
commit2905d556c486fafa1bfdbeaee5177c53ff9cba28 (patch)
tree9547ef76ce2262233b0f6e274b8b345b06dfd8b9 /example_app/ctprof_utility.c
parent0b2d677e1a958092321fe3b64be90e9cccd6e67f (diff)
downloadctprof_srv-2905d556c486fafa1bfdbeaee5177c53ff9cba28.tar.gz
ctprof_srv-2905d556c486fafa1bfdbeaee5177c53ff9cba28.tar.xz
ctprof_srv-2905d556c486fafa1bfdbeaee5177c53ff9cba28.zip
Added ctprof_sync.sh to release and updated ctprof_srv to supportBUILD_CTOOLSPROF_1.0_080913
a termination option when the clinet disconnects.
Diffstat (limited to 'example_app/ctprof_utility.c')
-rw-r--r--example_app/ctprof_utility.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/example_app/ctprof_utility.c b/example_app/ctprof_utility.c
index 1778a9c..d3a836d 100644
--- a/example_app/ctprof_utility.c
+++ b/example_app/ctprof_utility.c
@@ -58,11 +58,10 @@ static bool fifo_opened = false;
58 * Note - all messages are the same size in bytes. 58 * Note - all messages are the same size in bytes.
59 */ 59 */
60static const char msg_recording[] = "ctprof recording\n"; 60static const char msg_recording[] = "ctprof recording\n";
61static const char msg_stopped[] = "ctprof stopped \n"; 61static const char msg_stopped[] = "ctprof stopped__\n";
62static const char msg_ready[] = "ctprof ready \n"; 62static const char msg_ready[] = "ctprof ready____\n";
63static char readbuf[sizeof(msg_recording)]; 63static char readbuf[sizeof(msg_recording)];
64 64
65
66/* Note: This implementation uses named pipes for very 65/* Note: This implementation uses named pipes for very
67 * simple ipc. This could be changed in the future to 66 * simple ipc. This could be changed in the future to
68 * use sockets or some other ipc so check the requirements 67 * use sockets or some other ipc so check the requirements
@@ -122,7 +121,7 @@ ctprof_state_t ctprof_get_state(void)
122 * until data is avaiable. 121 * until data is avaiable.
123 */ 122 */
124 if (fifo_opened) { 123 if (fifo_opened) {
125 ctprof_pipe_read(readbuf, sizeof(readbuf)); 124 ctprof_pipe_read(readbuf, sizeof(readbuf)-1);
126 125
127 if (0 == strcmp(readbuf, msg_recording)) { 126 if (0 == strcmp(readbuf, msg_recording)) {
128 return CTPROF_RECORDING; 127 return CTPROF_RECORDING;