Changeset 5379:2a383aaf4b1b in roaraudio for roarclients


Ignore:
Timestamp:
12/26/11 09:57:46 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:
  • Cleanup,
  • Set ISIT_BUILD in roard,
  • Test for more alternatives for ssh-askpass,
  • Display more infors in "allinfo" command in roarctl,
  • Display server time using ctime_r() in roarctl.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarctl.c

    r5372 r5379  
    312312void server_time (struct roar_connection * con) { 
    313313 struct roar_time time; 
     314#ifdef ROAR_HAVE_CTIME_R 
     315 time_t server_time; 
     316 char server_time_buf[32]; 
     317#endif 
     318 
    314319 
    315320 if ( roar_get_time(con, &time) == -1 ) { 
     
    318323 } 
    319324 
     325#ifdef ROAR_HAVE_CTIME_R 
     326 server_time = time.t_sec; 
     327 if ( ctime_r(&server_time, server_time_buf) == NULL ) 
     328  server_time_buf[0] = 0; 
     329 
     330 if ( server_time_buf[0] ) 
     331  if ( server_time_buf[strlen(server_time_buf)-1] == '\n' ) 
     332   server_time_buf[strlen(server_time_buf)-1] = 0; 
     333#endif 
     334 
    320335 if ( g_verbose ) { 
    321   printf("Server time           : %llu.%06llu [+%llu/2^64] sec\n", 
     336  printf("Server time           : %s%s%s%llu.%06llu [+%llu/2^64] sec\n", 
     337#ifdef ROAR_HAVE_CTIME_R 
     338         "\"", 
     339         server_time_buf, 
     340         "\" ", 
     341#else 
     342         "", "", "", 
     343#endif 
    322344         (long long unsigned int)time.t_sec, 
    323345         (long long unsigned int) time.t_ssec / 18446744073709LLU, 
     
    325347 } else { 
    326348  if ( time.c_freq == 1000000000LL && time.t_ssec == 0 ) { 
    327    printf("Server time           : %llu sec\n", 
     349   printf("Server time           : %s%s%s%llu sec\n", 
     350#ifdef ROAR_HAVE_CTIME_R 
     351         "\"", 
     352         server_time_buf, 
     353         "\" ", 
     354#else 
     355         "", "", "", 
     356#endif 
    328357          (long long unsigned int)time.t_sec); 
    329358  } else { 
    330    printf("Server time           : %llu.%06llu sec\n", 
     359   printf("Server time           : %s%s%s%llu.%06llu sec\n", 
     360#ifdef ROAR_HAVE_CTIME_R 
     361         "\"", 
     362         server_time_buf, 
     363         "\" ", 
     364#else 
     365         "", "", "", 
     366#endif 
    331367          (long long unsigned int)time.t_sec, 
    332368          (long long unsigned int) time.t_ssec / 18446744073709LLU); 
     
    12851321   display_stream(&con, atoi(argv[++i])); 
    12861322  } else if ( !strcmp(k, "allinfo") ) { 
     1323   server_info(&con); 
     1324   printf("\n"); 
     1325   server_time(&con); 
     1326   printf("\n"); 
     1327   lib_standards(); 
     1328   printf("\n"); 
    12871329   server_oinfo(&con, -1); 
    12881330   printf("\n"); 
Note: See TracChangeset for help on using the changeset viewer.