[BACK]Return to tftp.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tftp

Diff for /src/usr.bin/tftp/tftp.c between version 1.24 and 1.25

version 1.24, 2014/10/21 06:15:16 version 1.25, 2017/09/10 07:29:39
Line 52 
Line 52 
 #include <stddef.h>  #include <stddef.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   #include <time.h>
 #include <unistd.h>  #include <unistd.h>
 #include <netdb.h>  #include <netdb.h>
   
Line 83 
Line 84 
 extern int                       opt_tout;  extern int                       opt_tout;
 extern int                       opt_blksize;  extern int                       opt_blksize;
   
 struct timeval  tstart;  struct timespec tstart;
 struct timeval  tstop;  struct timespec tstop;
 unsigned int    segment_size = SEGSIZE;  unsigned int    segment_size = SEGSIZE;
 unsigned int    packet_size = SEGSIZE + 4;  unsigned int    packet_size = SEGSIZE + 4;
   
Line 548 
Line 549 
 static void  static void
 startclock(void)  startclock(void)
 {  {
         (void)gettimeofday(&tstart, NULL);          clock_gettime(CLOCK_MONOTONIC, &tstart);
 }  }
   
 static void  static void
 stopclock(void)  stopclock(void)
 {  {
         (void)gettimeofday(&tstop, NULL);          clock_gettime(CLOCK_MONOTONIC, &tstop);
 }  }
   
 static void  static void
Line 563 
Line 564 
         double  delta;          double  delta;
   
         /* compute delta in 1/10's second units */          /* compute delta in 1/10's second units */
         delta = ((tstop.tv_sec * 10.) + (tstop.tv_usec / 100000)) -          delta = ((tstop.tv_sec * 10.) + (tstop.tv_nsec / 100000000)) -
             ((tstart.tv_sec * 10.) + (tstart.tv_usec / 100000));              ((tstart.tv_sec * 10.) + (tstart.tv_nsec / 100000000));
         delta = delta / 10.;    /* back to seconds */          delta = delta / 10.;    /* back to seconds */
         printf("%s %lu bytes in %.1f seconds", direction, amount, delta);          printf("%s %lu bytes in %.1f seconds", direction, amount, delta);
         if (verbose)          if (verbose)

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25