Changeset 5482 for pjproject/trunk/pjlib/src/pj/os_timestamp_posix.c
- Timestamp:
- Nov 15, 2016 2:23:38 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/os_timestamp_posix.c
r5457 r5482 181 181 { 182 182 struct timespec tp; 183 int err = -1; 183 184 184 185 if (s_alarm_fd == -1) { … … 187 188 s_alarm_fd = fd; 188 189 pj_atexit(&close_alarm_fd); 189 } else { 190 return PJ_RETURN_OS_ERROR(pj_get_native_os_error()); 191 } 192 } 193 int err = ioctl(s_alarm_fd, 194 ANDROID_ALARM_GET_TIME(ANDROID_ALARM_ELAPSED_REALTIME), &tp); 190 } 191 } 192 193 if (s_alarm_fd != -1) { 194 err = ioctl(s_alarm_fd, 195 ANDROID_ALARM_GET_TIME(ANDROID_ALARM_ELAPSED_REALTIME), &tp); 196 } 197 198 if (err != 0) { 199 /* Fallback to CLOCK_MONOTONIC if /dev/alarm is not found, or 200 * getting ANDROID_ALARM_ELAPSED_REALTIME fails. 201 */ 202 err = clock_gettime(CLOCK_MONOTONIC, &tp); 203 } 195 204 196 205 if (err != 0) {
Note: See TracChangeset
for help on using the changeset viewer.