Changeset 5065:18cdc8c3a1ab in roaraudio for roard/req.c
- Timestamp:
- 06/18/11 04:07:49 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/req.c
r5031 r5065 683 683 684 684 int req_on_gettimeofday (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) { 685 #if defined(ROAR_HAVE_GETTIMEOFDAY) || defined(ROAR_HAVE_TIME)686 685 struct roar_time curtime; 687 #ifdef ROAR_HAVE_GETTIMEOFDAY688 struct timeval tv;689 #elif defined(ROAR_HAVE_TIME)690 time_t now = time(NULL);691 #endif692 686 693 687 ROAR_DBG("req_on_gettimeofday(client=%i, mes=%p, data=%p, flags=%p) = ?", client, mes, data, flags); … … 713 707 ROAR_DBG("req_on_gettimeofday(client=%i, mes=%p, data=%p, flags=%p) = ?", client, mes, data, flags); 714 708 715 memset(&curtime, 0, sizeof(curtime)); 716 717 #ifdef ROAR_HAVE_GETTIMEOFDAY 718 if ( gettimeofday(&tv, NULL) == -1 ) 719 return -1; 720 curtime.t_sec = tv.tv_sec; 721 curtime.t_ssec = (uint64_t)tv.tv_usec * (uint64_t)18446744073709ULL; 722 #elif defined(ROAR_HAVE_TIME) 723 curtime.t_sec = now; 724 #endif 709 if ( roar_clock_gettime(&curtime, ROAR_CLOCK_REALTIME) == -1 ) 710 return -1; 725 711 726 712 if ( roar_time_to_msg(mes, &curtime) == -1 ) … … 732 718 733 719 return 0; 734 #else735 return -1;736 #endif737 720 } 738 721
Note: See TracChangeset
for help on using the changeset viewer.