Changeset 7715994 in mainline for uspace/srv/net/net/start/netstart.c


Ignore:
Timestamp:
2010-03-13T12:17:02Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6ba20a6b
Parents:
d0febca (diff), 2070570 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/net/start/netstart.c

    rd0febca r7715994  
    6262 *  @returns Other error codes as defined for the NET_NET_STARTUP message.
    6363 */
    64 int             main( int argc, char * argv[] );
     64int main(int argc, char * argv[]);
    6565
    6666/** Starts the module.
     
    6969 *  @returns Other error codes as defined for the task_spawn() function.
    7070 */
    71 task_id_t       spawn( char * fname );
     71task_id_t spawn(const char * fname);
    7272
    73 int main( int argc, char * argv[] ){
     73int main(int argc, char * argv[]){
    7474        ERROR_DECLARE;
    7575
    76         int             net_phone;
     76        int net_phone;
    7777
    78         printf( "Task %d - ", task_get_id());
    79         printf( "%s\n", NAME );
     78        // print the module label
     79        printf("Task %d - ", task_get_id());
     80        printf("%s\n", NAME);
     81
    8082        // run self tests
    81         ERROR_PROPAGATE( self_test());
    82         // start net service
    83         if( ! spawn( "/srv/net" )){
    84                 fprintf( stderr, "Could not spawn net\n" );
     83        ERROR_PROPAGATE(self_test());
     84
     85        // start the networking service
     86        if(! spawn("/srv/net")){
     87                fprintf(stderr, "Could not spawn net\n");
    8588                return EINVAL;
    8689        }
    87         // start net
    88         net_phone = connect_to_service( SERVICE_NETWORKING );
    89         if( ERROR_OCCURRED( ipc_call_sync_0_0( net_phone, NET_NET_STARTUP ))){
    90                 printf( "ERROR %d\n", ERROR_CODE );
     90
     91        // start the networking
     92        net_phone = connect_to_service(SERVICE_NETWORKING);
     93        if(ERROR_OCCURRED(ipc_call_sync_0_0(net_phone, NET_NET_STARTUP))){
     94                printf("ERROR %d\n", ERROR_CODE);
    9195                return ERROR_CODE;
    9296        }else{
    93                 printf( "OK\n" );
     97                printf("OK\n");
    9498        }
    9599
     
    97101}
    98102
    99 task_id_t spawn( char * fname ){
    100         char *  argv[ 2 ];
    101         task_id_t       res;
     103task_id_t spawn(const char * fname){
     104        const char * argv[2];
     105        task_id_t res;
    102106
    103         argv[ 0 ] = fname;
    104         argv[ 1 ] = NULL;
    105         res = task_spawn( fname, argv );
     107        argv[0] = fname;
     108        argv[1] = NULL;
     109        res = task_spawn(fname, argv);
    106110       
    107111        return res;
Note: See TracChangeset for help on using the changeset viewer.