Changeset afbf668 for owl.c


Ignore:
Timestamp:
Mar 1, 2004, 12:42:56 PM (20 years ago)
Author:
Erik Nygren <nygren@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
948b942
Parents:
c61918e
Message:
	pexec will now incrimentally display data as it is output
	  by the child process.  Additionally, commands running under
	  pexec may now be killed by quitting out of the popless window.
	Added muxevents select loop dispatcher.  File descriptors may
	  be registered with muxevents and handlers will be dispatched
	  to when data is available for non-blocking read/write/except.
	Switched the stderr_redir stuff to use muxevents.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    r5d365f6 rafbf668  
    5757#endif
    5858int stderr_replace(void);
    59 void stderr_redirect(int rfd);
    6059#endif
    6160
     
    196195  owl_function_debugmsg("startup: doing stderr redirection");
    197196  newstderr = stderr_replace();
     197  owl_muxevents_add(owl_global_get_muxevents(&g), newstderr, OWL_MUX_READ,
     198                    stderr_redirect_handler, NULL);
    198199#endif   
    199200
     
    579580      }
    580581    }
     582
     583    /* dispatch any muxevents */
     584    owl_muxevents_dispatch(owl_global_get_muxevents(&g), 0);
    581585
    582586    /* follow the last message if we're supposed to */
     
    665669    }
    666670
    667 #if OWL_STDERR_REDIR
    668     stderr_redirect(newstderr);
    669 #endif   
    670 
    671671    /* Log any error signals */
    672672    {
     
    675675      if ((signum = owl_global_get_errsignal_and_clear(&g, &si)) > 0) {
    676676        owl_function_error("Got unexpected signal: %d %s  (code: %d band: %d  errno: %d)",
    677                            signum, signum==SIGPIPE?"SIGPIPE":"",
     677                           signum, signum==SIGPIPE?"SIGPIPE":"SIG????",
    678678                           si.si_code, si.si_band, si.si_errno);
    679679      }
     
    690690     */
    691691    owl_function_resize();
    692   } else if (sig==SIGPIPE) {
     692  } else if (sig==SIGPIPE || sig==SIGCHLD) {
    693693    /* Set a flag and some info that we got the sigpipe
    694694     * so we can record that we got it and why... */
     
    732732}
    733733
    734 /* Sends stderr (read from rfd) messages to a file */
    735 void stderr_redirect(int rfd)
     734/* Sends stderr (read from rfd) messages to the error console */
     735void stderr_redirect_handler(int handle, int rfd, int eventmask, void *data)
    736736{
    737737  int navail, bread;
Note: See TracChangeset for help on using the changeset viewer.