- Timestamp:
- 09/01/16 16:27:23 (4 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- ccc598d
- Parents:
- 903f64d
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_linux_common.c
ree6e802 r1d780e4 242 242 243 243 /* These don't typically reset however an interface does exist to reset them */ 244 static int linuxcommon_get_dev_statis itics(libtrace_t *libtrace, struct linux_dev_stats *stats) {244 static int linuxcommon_get_dev_statistics(libtrace_t *libtrace, struct linux_dev_stats *stats) { 245 245 FILE *file; 246 246 char line[1024]; … … 253 253 254 254 /* Skip 2 header lines */ 255 fgets(line, sizeof(line), file); 256 fgets(line, sizeof(line), file); 255 if (fgets(line, sizeof(line), file) == NULL) { 256 fclose(file); 257 return -1; 258 } 259 260 if (fgets(line, sizeof(line), file) == NULL) { 261 fclose(file); 262 return -1; 263 } 257 264 258 265 while (!(feof(file)||ferror(file))) { 259 266 int tot; 260 fgets(line, sizeof(line), file); 267 if (fgets(line, sizeof(line), file) == NULL) 268 break; 269 261 270 tot = sscanf(line, " %"xstr(IF_NAMESIZE)"[^:]:" REPEAT_16(" %"SCNd64), 262 271 tmp_stats.if_name, … … 436 445 FORMAT_DATA->stats.tp_drops = 0; 437 446 438 if (linuxcommon_get_dev_statis itics(libtrace, &FORMAT_DATA->dev_stats) != 0) {447 if (linuxcommon_get_dev_statistics(libtrace, &FORMAT_DATA->dev_stats) != 0) { 439 448 /* Mark this as bad */ 440 449 FORMAT_DATA->dev_stats.if_name[0] = 0; … … 527 536 /* Note these statistics come from two different sources, the socket itself and 528 537 * the linux device. As such this means it is highly likely that their is some 529 * margin of error in the returned statis itics, we perform basic sanitising so538 * margin of error in the returned statistics, we perform basic sanitising so 530 539 * that these are not too noticable. 531 540 */ … … 544 553 /* Do we have starting stats to compare to? */ 545 554 if (FORMAT_DATA->dev_stats.if_name[0] != 0) { 546 linuxcommon_get_dev_statis itics(libtrace, &dev_stats);555 linuxcommon_get_dev_statistics(libtrace, &dev_stats); 547 556 } 548 557 linuxcommon_update_socket_statistics(libtrace); -
lib/format_pcap.c
r62dec50 r1d780e4 345 345 } 346 346 347 static int pcap_pause_input(libtrace_t *libtrace )347 static int pcap_pause_input(libtrace_t *libtrace UNUSED) 348 348 { 349 349 return 0; /* success */
Note: See TracChangeset
for help on using the changeset viewer.