Changeset 37059
- Timestamp:
- Jul 17, 2014, 11:51:53 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20130712/Ohana/src/opihi/pcontrol/PclientCommand.c
r27435 r37059 25 25 return (PCLIENT_DOWN); 26 26 } 27 27 28 28 // prepare host to accept response 29 29 host[0].response_state = response_state; … … 35 35 return (PCLIENT_GOOD); 36 36 } 37 37 38 # define MARKTIME(MSG,...) { \ 39 gettimeofday (&stopTimer, (void *) NULL); \ 40 float dtime = DTIME (stopTimer, startTimer); \ 41 fprintf (stderr, MSG, __VA_ARGS__); } 42 43 # define INITTIME \ 44 struct timeval startTimer, stopTimer; \ 45 gettimeofday (&startTimer, (void *) NULL); 46 38 47 // check for response; message must end with specified string. 39 48 // accumulate the response in the buffer … … 47 56 ASSERT (response != NULL, "response missing"); 48 57 ASSERT (buffer != NULL, "buffer missing"); 58 59 // INITTIME; 49 60 50 61 /* avoid blocking very long on read, test every 100 usec, up to 0.1 sec */ … … 66 77 return (PCLIENT_DOWN); 67 78 } 68 if (line == NULL) return (PCLIENT_HUNG); 69 if (status == -1) return (PCLIENT_HUNG); 79 if (line == NULL) { 80 // MARKTIME ("-- client hung (line NULL): %s : %f sec\n", host[0].hostname, dtime); 81 return (PCLIENT_HUNG); 82 } 83 if (status == -1) { 84 // MARKTIME ("-- client hung (status -1): %s : %f sec\n", host[0].hostname, dtime); 85 return (PCLIENT_HUNG); 86 } 70 87 71 88 // fprintf (stderr, "response: %s\n", buffer[0].buffer); … … 75 92 76 93 /* memstr returns a view, not an allocated string : don't free */ 77 /* ReadtoIOBuffer returns : 94 /* ReadtoIOBuffer returns : 78 95 0 - pipe closed 79 96 -1 - no more data in pipe, data not ready
Note:
See TracChangeset
for help on using the changeset viewer.
