Changeset 18277
- Timestamp:
- Jun 22, 2008, 8:54:26 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libkapa/src/IOfuncs.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libkapa/src/IOfuncs.c
r16466 r18277 1 1 # include <kapa_internal.h> 2 # define DEBUG 0 2 3 3 4 /** these function expect to operate with a BLOCKing socket **/ … … 63 64 status = read (device, buffer, 16); 64 65 buffer[16] = 0; 65 if (status != 16) fprintf (stderr, "dropped message length\n"); 66 if (status != 16) { 67 fprintf (stderr, "dropped message length\n"); 68 } 69 if (DEBUG) fprintf (stderr, "recv buffer: %s\n", buffer); 66 70 67 71 /* find the message length, allocate space */ … … 71 75 /* read Nbytes from the device */ 72 76 status = read (device, message, Nbytes); 73 if (status != Nbytes) fprintf (stderr, "Kii/Kapa comm error\n"); 77 if (status != Nbytes) { 78 fprintf (stderr, "Kii/Kapa comm error\n"); 79 } 74 80 message[status] = 0; 75 81 /* make the string easy to parse */ 76 82 77 //fprintf (stderr, "recv: %s\n", message);83 if (DEBUG) fprintf (stderr, "recv: %s\n", message); 78 84 79 85 /* scan the incoming message */ … … 112 118 write (device, string, length); 113 119 114 //fprintf (stderr, "send: %s\n", string);120 if (DEBUG) fprintf (stderr, "send: %s\n", string); 115 121 116 122 free (string); … … 129 135 /* read Nbytes from the device */ 130 136 status = read (device, message, length); 137 if (DEBUG) fprintf (stderr, "recv message: %s\n", message); 131 138 132 139 if (status != length) {
Note:
See TracChangeset
for help on using the changeset viewer.
