@@ -642,93 +642,6 @@ flux_watcher_t *flux_idle_watcher_create (flux_reactor_t *r,
642642 return w ;
643643}
644644
645- /* Child
646- */
647-
648- struct child_watcher {
649- ev_child evw ;
650- };
651-
652- static void child_watcher_start (flux_watcher_t * w )
653- {
654- struct ev_loop * loop = watcher_get_ev (w );
655- struct child_watcher * cw = watcher_get_data (w );
656- bool active = ev_is_active (& cw -> evw );
657- ev_child_start (loop , & cw -> evw );
658- watcher_start_post_ev (w , active );
659- }
660-
661- static void child_watcher_stop (flux_watcher_t * w )
662- {
663- struct ev_loop * loop = watcher_get_ev (w );
664- struct child_watcher * cw = watcher_get_data (w );
665- watcher_stop_pre_ev (w );
666- ev_child_stop (loop , & cw -> evw );
667- }
668-
669- static bool child_watcher_is_active (flux_watcher_t * w )
670- {
671- struct child_watcher * cw = watcher_get_data (w );
672- return ev_is_active (& cw -> evw );
673- }
674-
675- static void child_watcher_cb (struct ev_loop * loop , ev_child * evw , int revents )
676- {
677- struct flux_watcher * w = evw -> data ;
678- watcher_call_ev (w , revents );
679- }
680-
681- static struct flux_watcher_ops child_watcher_ops = {
682- .start = child_watcher_start ,
683- .stop = child_watcher_stop ,
684- .ref = watcher_ref_ev ,
685- .unref = watcher_unref_ev ,
686- .is_active = child_watcher_is_active ,
687- .destroy = NULL ,
688- };
689-
690- flux_watcher_t * flux_child_watcher_create (flux_reactor_t * r ,
691- int pid ,
692- bool trace ,
693- flux_watcher_f cb ,
694- void * arg )
695- {
696- flux_watcher_t * w ;
697- struct child_watcher * cw ;
698-
699- if (!ev_is_default_loop (reactor_get_loop (r ))) {
700- errno = EINVAL ;
701- return NULL ;
702- }
703- if (!(w = watcher_create (r , sizeof (* cw ), & child_watcher_ops , cb , arg )))
704- return NULL ;
705- cw = watcher_get_data (w );
706- ev_child_init (& cw -> evw , child_watcher_cb , pid , trace ? 1 : 0 );
707- cw -> evw .data = w ;
708-
709- return w ;
710- }
711-
712- int flux_child_watcher_get_rpid (flux_watcher_t * w )
713- {
714- if (watcher_get_ops (w ) != & child_watcher_ops ) {
715- errno = EINVAL ;
716- return -1 ;
717- }
718- struct child_watcher * cw = watcher_get_data (w );
719- return cw -> evw .rpid ;
720- }
721-
722- int flux_child_watcher_get_rstatus (flux_watcher_t * w )
723- {
724- if (watcher_get_ops (w ) != & child_watcher_ops ) {
725- errno = EINVAL ;
726- return -1 ;
727- }
728- struct child_watcher * cw = watcher_get_data (w );
729- return cw -> evw .rstatus ;
730- }
731-
732645/* Signal
733646 */
734647
0 commit comments