It can only be used if defined(HAVE_FORK) || defined(HAVE_VFORK).
e.g. not on Windows systems.
Update print_usage().
Update the man page.
(backported from commit
43064ae5a5e9f882b62d7270bfff675f742702e4)
.B \-z bzip2
will compress each savefile using gzip or bzip2.
.IP
+This option can only be used if fork subprocess is implemented (e.g. not on Windows systems).
+.IP
Note that tcpdump will run the command in parallel to the capture, using
the lowest priority so that this doesn't disturb the capture process.
.IP
#define U_FLAG
#endif
-#define SHORTOPTS "aAb" B_FLAG "c:C:d" D_FLAG "eE:fF:G:hHi:" I_FLAG j_FLAG J_FLAG "KlLm:M:nNOpq" Q_FLAG "r:s:StT:u" U_FLAG "vV:w:W:xXy:Yz:Z:#"
+#if defined(HAVE_FORK) || defined(HAVE_VFORK)
+#define z_FLAG "z:"
+#define z_FLAG_USAGE "[ -z postrotate-command ] "
+#else
+#define z_FLAG
+#define z_FLAG_USAGE
+#endif
+
+#define SHORTOPTS "aAb" B_FLAG "c:C:d" D_FLAG "eE:fF:G:hHi:" I_FLAG j_FLAG J_FLAG "KlLm:M:nNOpq" Q_FLAG "r:s:StT:u" U_FLAG "vV:w:W:xXy:Y" z_FLAG "Z:#"
/*
* Long options.
}
break;
#endif
- case 'z':
+
#if defined(HAVE_FORK) || defined(HAVE_VFORK)
+ case 'z':
zflag = optarg;
-#else
- error("-z cannot be used. Fork subprocess not implemented.");
-#endif
break;
+#endif
case 'Z':
username = optarg;
"\t\t[ --time-stamp-precision precision ] [ --micro ] [ --nano ]\n");
#endif
(void)fprintf(f,
-"\t\t[ -z postrotate-command ] [ -Z user ] [ expression ]\n");
+"\t\t" z_FLAG_USAGE "[ -Z user ] [ expression ]\n");
}