- result_len = read(tp.read_fd, result, 10);
- close(tp.read_fd);
-
- if ((result_len > 0) && (strcmp(result, "OK") == 0)) {
- tids->req_count++;
- tr_debug("tids_sweep_procs: TID process %d succeeded", tp.pid);
- } else {
- tids->error_count++;
- tr_debug("tids_sweep_procs: TID process %d failed", tp.pid);
- }
+ } else if (wait_rc > 0) {
+ tr_err("tids_sweep_procs: waitpid returned pid %d, expected %d", wait_rc, tp.pid);
+ }
+
+ /* read the pipe - if the TID request worked, it will have written status before terminating */
+ result_len = read(tp.read_fd, result, sizeof(result)/sizeof(result[0]));
+ close(tp.read_fd);
+
+ if ((result_len > 0) && (strcmp(result, "OK") == 0)) {
+ tids->req_count++;
+ tr_debug("tids_sweep_procs: TID process %d succeeded", tp.pid);
+ } else {
+ tids->error_count++;
+ tr_debug("tids_sweep_procs: TID process %d failed", tp.pid);