Changeset 858fc90 in mainline for uspace/srv/net/net/start/netstart.c
- Timestamp:
- 2010-03-15T19:35:25Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6092b56e
- Parents:
- 92307f1 (diff), 4684368 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/net/start/netstart.c
r92307f1 r858fc90 62 62 * @returns Other error codes as defined for the NET_NET_STARTUP message. 63 63 */ 64 int main( int argc, char * argv[]);64 int main(int argc, char * argv[]); 65 65 66 66 /** Starts the module. … … 69 69 * @returns Other error codes as defined for the task_spawn() function. 70 70 */ 71 task_id_t spawn( const char * fname);71 task_id_t spawn(const char * fname); 72 72 73 int main( int argc, char * argv[]){73 int main(int argc, char * argv[]){ 74 74 ERROR_DECLARE; 75 75 76 int 76 int net_phone; 77 77 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 80 82 // 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"); 85 88 return EINVAL; 86 89 } 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); 91 95 return ERROR_CODE; 92 96 }else{ 93 printf( "OK\n");97 printf("OK\n"); 94 98 } 95 99 … … 97 101 } 98 102 99 task_id_t spawn( const char * fname){100 const char * argv[ 2];101 task_id_t 103 task_id_t spawn(const char * fname){ 104 const char * argv[2]; 105 task_id_t res; 102 106 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); 106 110 107 111 return res;
Note:
See TracChangeset
for help on using the changeset viewer.