Changeset b40bfac in mainline for uspace/app/netstart/netstart.c
- Timestamp:
- 2010-11-08T07:13:25Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63a1e60
- Parents:
- d70a463 (diff), 3da12d74 (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 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/netstart/netstart.c
rd70a463 rb40bfac 32 32 33 33 /** @file 34 *35 34 * Start the networking subsystem. 36 * Perform networking self-test if executed37 * with the -s argument.38 *39 35 */ 40 36 … … 45 41 #include <task.h> 46 42 #include <str_error.h> 47 #include <err.h>48 43 #include <ipc/ipc.h> 49 44 #include <ipc/services.h> … … 52 47 #include <net/modules.h> 53 48 54 #include "self_test.h"55 56 49 /** Start a module. 57 50 * 58 * @param[in] desc The module description 59 * @param[in] path The module absolute path. 60 * 61 * @returns true on succesful spanwning 62 * @returns false on failure 63 * 51 * @param[in] desc The module description 52 * @param[in] path The module absolute path. 53 * @returns True on succesful spanwning. 54 * @returns False on failure 64 55 */ 65 56 static bool spawn(const char *desc, const char *path) 66 57 { 58 int rc; 59 67 60 printf("%s: Spawning %s (%s)\n", NAME, desc, path); 68 69 const char *argv[2]; 70 71 argv[0] = path; 72 argv[1] = NULL; 73 74 int err; 75 if (task_spawn(path, argv, &err) == 0) { 61 rc = task_spawnl(NULL, path, path, NULL); 62 if (rc != EOK) { 76 63 fprintf(stderr, "%s: Error spawning %s (%s)\n", NAME, path, 77 str_error( err));64 str_error(rc)); 78 65 return false; 79 66 } … … 84 71 int main(int argc, char *argv[]) 85 72 { 86 ERROR_DECLARE; 87 88 /* Run self-tests */ 89 if ((argc > 1) && (str_cmp(argv[1], "-s") == 0)) 90 ERROR_PROPAGATE(self_test()); 73 int rc; 91 74 92 75 if (!spawn("networking service", "/srv/net")) … … 96 79 97 80 int net_phone = connect_to_service(SERVICE_NETWORKING); 98 if (ERROR_OCCURRED(ipc_call_sync_0_0(net_phone, NET_NET_STARTUP))) { 99 fprintf(stderr, "%s: Startup error %d\n", NAME, ERROR_CODE); 100 return ERROR_CODE; 81 rc = ipc_call_sync_0_0(net_phone, NET_NET_STARTUP); 82 if (rc != EOK) { 83 fprintf(stderr, "%s: Startup error %d\n", NAME, rc); 84 return rc; 101 85 } 102 86
Note:
See TracChangeset
for help on using the changeset viewer.