Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
Print the supported time stamp types (-J) to stdout instead of stderr
Browse files Browse the repository at this point in the history
It is not an error, thus print them to stdout.

(cherry picked from commit 25f672e)
  • Loading branch information
fxlb committed Oct 6, 2023
1 parent dbb8659 commit 9fec4d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tcpdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,15 @@ show_tstamp_types_and_exit(pcap_t *pc, const char *device)
device);
exit_tcpdump(S_SUCCESS);
}
fprintf(stderr, "Time stamp types for %s (use option -j to set):\n",
fprintf(stdout, "Time stamp types for %s (use option -j to set):\n",
device);
for (i = 0; i < n_tstamp_types; i++) {
tstamp_type_name = pcap_tstamp_type_val_to_name(tstamp_types[i]);
if (tstamp_type_name != NULL) {
(void) fprintf(stderr, " %s (%s)\n", tstamp_type_name,
(void) fprintf(stdout, " %s (%s)\n", tstamp_type_name,
pcap_tstamp_type_val_to_description(tstamp_types[i]));
} else {
(void) fprintf(stderr, " %d\n", tstamp_types[i]);
(void) fprintf(stdout, " %d\n", tstamp_types[i]);
}
}
pcap_free_tstamp_types(tstamp_types);
Expand Down

0 comments on commit 9fec4d6

Please sign in to comment.