Lines Matching defs:sp
60 stream_prepare_init(stream_prepare_t *sp, const atf_process_stream_t *sb)
66 sp->m_sb = sb;
67 sp->m_pipefds_ok = false;
70 if (pipe(sp->m_pipefds) == -1)
74 sp->m_pipefds_ok = true;
84 stream_prepare_fini(stream_prepare_t *sp)
86 if (sp->m_pipefds_ok) {
87 close(sp->m_pipefds[0]);
88 close(sp->m_pipefds[1]);
329 child_connect(const stream_prepare_t *sp, int procfd)
332 const int type = atf_process_stream_type(sp->m_sb);
335 close(sp->m_pipefds[0]);
336 err = safe_dup(sp->m_pipefds[1], procfd);
338 if (dup2(sp->m_sb->m_tgt_fd, sp->m_sb->m_src_fd) == -1)
340 sp->m_sb->m_tgt_fd, sp->m_sb->m_src_fd);
346 err = safe_dup(sp->m_sb->m_fd, procfd);
348 int aux = open(atf_fs_path_cstring(sp->m_sb->m_path),
352 atf_fs_path_cstring(sp->m_sb->m_path));
368 parent_connect(const stream_prepare_t *sp, int *fd)
370 const int type = atf_process_stream_type(sp->m_sb);
373 close(sp->m_pipefds[1]);
374 *fd = sp->m_pipefds[0];