#endif
static int Wflag; /* recycle output files after this number of files */
static int WflagChars;
+#if defined(HAVE_FORK) || defined(HAVE_VFORK)
static char *zflag = NULL; /* compress each savefile using a specified command (like gzip or bzip2) */
+#endif
static int timeout = 1000; /* default timeout = 1000 ms = 1 s */
#ifdef HAVE_PCAP_SET_IMMEDIATE_MODE
static int immediate_mode;
break;
#endif
case 'z':
+#if defined(HAVE_FORK) || defined(HAVE_VFORK)
zflag = optarg;
+#else
+ warning("-z ignored. Fork subprocess not implemented.\n");
+#endif
break;
case 'Z':
_exit(S_ERR_HOST_PROGRAM);
#endif
}
-#else /* HAVE_FORK && HAVE_VFORK */
-static void
-compress_savefile(const char *filename)
-{
- fprintf(stderr,
- "%s failed. Functionality not implemented under your system\n",
- __func__);
-}
-#endif /* HAVE_FORK && HAVE_VFORK */
+#endif /* HAVE_FORK || HAVE_VFORK */
static void
dump_packet_and_trunc(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
*/
pcap_dump_close(dump_info->pdd);
+#if defined(HAVE_FORK) || defined(HAVE_VFORK)
/*
* Compress the file we just closed, if the user asked for it
*/
if (zflag != NULL)
compress_savefile(dump_info->CurrentFileName);
+#endif
/*
* Check to see if we've exceeded the Wflag (when
*/
pcap_dump_close(dump_info->pdd);
+#if defined(HAVE_FORK) || defined(HAVE_VFORK)
/*
* Compress the file we just closed, if the user
* asked for it.
*/
if (zflag != NULL)
compress_savefile(dump_info->CurrentFileName);
+#endif
Cflag_count++;
if (Wflag > 0) {