]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Print the supported time stamp types (-J) to stdout instead of stderr
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 8 Jul 2021 10:26:36 +0000 (12:26 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 8 Jul 2021 10:34:11 +0000 (12:34 +0200)
It is not an error, thus print them to stdout.

tcpdump.c

index b7b6f99555eb9863a4d837f6c0c1109758785c81..4c56faf49d06a743d6eb6fab2384720d02a44d30 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -419,15 +419,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);