Lines Matching refs:descriptors
189 get_next_out (FILE **descriptors, int nfiles, int idx) in get_next_out() argument
192 if (descriptors[idx]) in get_next_out()
201 fail_output (FILE **descriptors, char **files, int i) in fail_output() argument
207 if (descriptors[i] == stdout) in fail_output()
215 descriptors[i] = nullptr; in fail_output()
228 FILE **descriptors; in tee_files() local
247 descriptors = xnmalloc (nfiles + 1, sizeof *descriptors); in tee_files()
251 descriptors[0] = stdout; in tee_files()
253 out_pollable[0] = iopoll_output_ok (fileno (descriptors[0])); in tee_files()
261 descriptors[i] = fopen (files[i], mode_string); in tee_files()
262 if (descriptors[i] == nullptr) in tee_files()
274 out_pollable[i] = iopoll_output_ok (fileno (descriptors[i])); in tee_files()
275 setvbuf (descriptors[i], nullptr, _IONBF, 0); in tee_files()
285 int err = iopoll (STDIN_FILENO, fileno (descriptors[first_out]), in tee_files()
292 if (fail_output (descriptors, files, first_out)) in tee_files()
295 first_out = get_next_out (descriptors, nfiles, first_out); in tee_files()
314 if (descriptors[i] in tee_files()
315 && ! fwrite_wait (buffer, bytes_read, descriptors[i])) in tee_files()
317 if (fail_output (descriptors, files, i)) in tee_files()
321 first_out = get_next_out (descriptors, nfiles, first_out); in tee_files()
333 if (descriptors[i] && ! fclose_wait (descriptors[i])) in tee_files()
339 free (descriptors); in tee_files()