Changeset 3115

Show
Ignore:
Timestamp:
02/02/00 23:36:58 (15 years ago)
Author:
ucacoxh
Message:

- Fix controller to only quit upon hearing byes from one of it's children.

Was quiting when other tools using mbus said bye.

Location:
rat/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • rat/trunk/MODS

    r3114 r3115  
    10641064        - Add controller validation of command-line addresses before  
    10651065          launching sub-processes. 
     1066        - Fix controller only quits upon hearing byes from one of it's  
     1067          children. 
    10661068 
    10671069TODO -- They're features not bugs dammit! 
  • rat/trunk/mbus_control.c

    r3078 r3115  
    5353        UNUSED(data); 
    5454 
     55        debug_msg("Got quit %s\n", srce); 
     56 
    5557        /* We mark ourselves as ready to exit. The main() will */ 
    5658        /* cleanup and terminate all our subprocesses.         */ 
     
    6062static void rx_mbus_bye(char *srce, char *args, void *data) 
    6163{ 
    62         UNUSED(srce); 
     64        pid_t pid_msgsrc; 
     65        char *lc; 
     66        int   i; 
     67 
     68        /* Find last colon */ 
     69        for (i = 0, lc = NULL; srce[i] != 0; i++) { 
     70                if (srce[i] == ':') { 
     71                        lc = srce; 
     72                } 
     73        } 
     74 
     75        assert(lc != NULL); 
     76        /* Skip past colon, next char should okay for atoi */ 
     77        pid_msgsrc = atoi(lc + 1); 
     78        if (pid_msgsrc == getpid() || 
     79            pid_msgsrc == pid_ui   || 
     80            pid_msgsrc == pid_engine) { 
     81                /* We mark ourselves as ready to exit. The main() will */ 
     82                /* cleanup and terminate all our subprocesses.         */ 
     83                should_exit = TRUE; 
     84        } 
    6385        UNUSED(args); 
    6486        UNUSED(data); 
    65  
    66         /* We mark ourselves as ready to exit. The main() will */ 
    67         /* cleanup and terminate all our subprocesses.         */ 
    68         should_exit = TRUE; 
    6987} 
    7088