diff options
author | axel <axel@liljencrantz.se> | 2005-10-08 21:20:51 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2005-10-08 21:20:51 +1000 |
commit | 9ae7fa5831cbc0a7d221c566bcd8633e609b9670 (patch) | |
tree | e58edf5437595dc50ff8595c23215f13efb190f9 /proc.c | |
parent | 93eed7bc352d7c5f26097c70b3ee324c9f4947ca (diff) |
Move io redirection functions to their own library
darcs-hash:20051008112051-ac50b-113caa4cba470a739e4bfbed9f479e2fed357be7.gz
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 81 |
1 files changed, 0 insertions, 81 deletions
@@ -74,77 +74,6 @@ int is_event=0; int proc_had_barrier; pid_t proc_last_bg_pid = 0; -io_data_t *io_add( io_data_t *list, io_data_t *element ) -{ - io_data_t *curr = list; - if( curr == 0 ) - return element; - while( curr->next != 0 ) - curr = curr->next; - curr->next = element; - return list; -} - -io_data_t *io_remove( io_data_t *list, io_data_t *element ) -{ - io_data_t *curr, *prev=0; - for( curr=list; curr; curr = curr->next ) - { - if( element == curr ) - { - if( prev == 0 ) - { - io_data_t *tmp = element->next; - element->next = 0; - return tmp; - } - else - { - prev->next = element->next; - element->next = 0; - return list; - } - } - prev = curr; - } - return list; -} - -io_data_t *io_duplicate( io_data_t *l ) -{ - io_data_t *res; - - if( l == 0 ) - return 0; - - res = malloc( sizeof( io_data_t) ); - - if( !res ) - { - die_mem(); - - } - - memcpy( res, l, sizeof(io_data_t )); - res->next=io_duplicate( l->next ); - return res; -} - -io_data_t *io_get( io_data_t *io, int fd ) -{ - if( io == 0 ) - return 0; - - io_data_t *res = io_get( io->next, fd ); - if( res ) - return res; - - if( io->fd == fd ) - return io; - - return 0; -} - /** Recursively free a process and those following it @@ -368,7 +297,6 @@ static void mark_process_status( job_t *j, else { p->completed = 1; -// fwprintf( stderr, L"Proc %d (%ls) exited\n", p->pid, p->actual_cmd ); if (( !WIFEXITED( status ) ) && (! WIFSIGNALED( status )) ) @@ -743,15 +671,6 @@ static int select_try( job_t *j ) int maxfd=-1; io_data_t *d; - - -/* if( j->stop_reading ) - { - sleep(1); - return; - } -*/ - FD_ZERO(&fds); for( d = j->io; d; d=d->next ) |