Changeset 8354ca6 in mainline
- Timestamp:
- 2012-04-04T17:00:23Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- aeb49e9
- Parents:
- f7a0779
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/date/date.c
rf7a0779 r8354ca6 44 44 size_t svc_cnt; 45 45 service_id_t *svc_ids = NULL; 46 service_id_t svc_id; 46 47 char *svc_name = NULL; 47 char *devpath;48 devman_handle_t devh;49 48 struct tm t; 50 49 … … 78 77 } 79 78 80 const char delim = '/';81 devpath = str_chr(svc_name, delim);82 83 if (!devpath) {84 printf(NAME ": Device name format not recognized\n");79 /* Get the service id for the device */ 80 rc = loc_service_get_id(svc_name, &svc_id, 0); 81 if (rc != EOK) { 82 printf(NAME ": Cannot get the service id for device %s", 83 svc_name); 85 84 goto exit; 86 85 } 87 86 88 /* Skip the delimiter */ 89 devpath++; 90 91 printf("Found device %s\n", devpath); 92 93 /* Get the device's handle */ 94 rc = devman_fun_get_handle("/hw/pci0/00:01.0/cmos-rtc/a", &devh, 95 IPC_FLAG_BLOCKING); 96 if (rc != EOK) { 97 printf(NAME ": Cannot open the device\n"); 98 goto exit; 99 } 100 101 /* Now connect to the device */ 102 async_sess_t *sess = devman_device_connect(EXCHANGE_SERIALIZE, 103 devh, IPC_FLAG_BLOCKING); 87 /* Connect to the device */ 88 async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, 89 svc_id, 0); 104 90 if (!sess) { 105 91 printf(NAME ": Cannot connect to the device\n"); … … 107 93 } 108 94 109 /* Read the current date */95 /* Read the current date/time */ 110 96 rc = clock_dev_time_get(sess, &t); 111 97 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.