diff --git a/src/source-pcap-file.c b/src/source-pcap-file.c index 5730d4ae85..870f8f2d09 100644 --- a/src/source-pcap-file.c +++ b/src/source-pcap-file.c @@ -385,8 +385,9 @@ void ReceivePcapFileThreadExitStats(ThreadVars *tv, void *data) SCLogInfo("1/%" PRIu64 "th of packets have an invalid checksum", chrate); } - SCLogNotice("read %" PRIu64 " files, %" PRIu64 " packets, %" PRIu64 " bytes", - ptv->shared.files, ptv->shared.pkts, ptv->shared.bytes); + SCLogNotice("read %" PRIu64 " file%s, %" PRIu64 " packets, %" PRIu64 " bytes", + ptv->shared.files, ptv->shared.files == 1 ? "" : "s", ptv->shared.pkts, + ptv->shared.bytes); } } diff --git a/src/suricata.c b/src/suricata.c index 7de612e049..e62d2357a1 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -1422,7 +1422,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri) else if(strcmp((long_opts[option_index]).name , "pfring-cluster-id") == 0){ #ifdef HAVE_PFRING if (ConfSetFinal("pfring.cluster-id", optarg) != 1) { - fprintf(stderr, "ERROR: Failed to set pfring.cluster-id.\n"); + SCLogError("failed to set pfring.cluster-id"); return TM_ECODE_FAILED; } #else @@ -1434,7 +1434,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri) else if(strcmp((long_opts[option_index]).name , "pfring-cluster-type") == 0){ #ifdef HAVE_PFRING if (ConfSetFinal("pfring.cluster-type", optarg) != 1) { - fprintf(stderr, "ERROR: Failed to set pfring.cluster-type.\n"); + SCLogError("failed to set pfring.cluster-type"); return TM_ECODE_FAILED; } #else @@ -1637,7 +1637,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri) } else if (strcmp((long_opts[option_index]).name, "pcap-buffer-size") == 0) { #ifdef HAVE_PCAP_SET_BUFF if (ConfSetFinal("pcap.buffer-size", optarg) != 1) { - fprintf(stderr, "ERROR: Failed to set pcap-buffer-size.\n"); + SCLogError("failed to set pcap-buffer-size"); return TM_ECODE_FAILED; } #else @@ -1729,7 +1729,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri) } else if (strcmp((long_opts[option_index]).name, "pcap-file-recursive") == 0) { if (ConfSetFinal("pcap-file.recursive", "true") != 1) { - SCLogError("ERROR: Failed to set pcap-file.recursive"); + SCLogError("failed to set pcap-file.recursive"); return TM_ECODE_FAILED; } } @@ -1918,7 +1918,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri) struct stat buf; if (stat(optarg, &buf) != 0) { #endif /* OS_WIN32 */ - SCLogError("ERROR: Pcap file does not exist\n"); + SCLogError("pcap file '%s': %s", optarg, strerror(errno)); return TM_ECODE_FAILED; } if (ConfSetFinal("pcap-file.file", optarg) != 1) { diff --git a/src/util-debug.c b/src/util-debug.c index c26710c634..f6c602b083 100644 --- a/src/util-debug.c +++ b/src/util-debug.c @@ -295,6 +295,9 @@ static const char *SCTransformModule(const char *module_name, int *dn_len) } else if (strncmp("util-", module_name, 5) == 0) { *dn_len = strlen(module_name) - 5; return module_name + 5; + } else if (strncmp("source-pcap-file", module_name, 16) == 0) { + *dn_len = strlen("pcap"); + return "pcap"; } else if (strncmp("source-", module_name, 7) == 0) { *dn_len = strlen(module_name) - 7; return module_name + 7;