@@ -203,7 +203,9 @@ static int Qflag = -1; /* restrict captured packet by send/receive direction *
203
203
static int Uflag ; /* "unbuffered" output of dump files */
204
204
static int Wflag ; /* recycle output files after this number of files */
205
205
static int WflagChars ;
206
+ #if defined(HAVE_FORK ) || defined(HAVE_VFORK )
206
207
static char * zflag = NULL ; /* compress each savefile using a specified command (like gzip or bzip2) */
208
+ #endif
207
209
static int timeout = 1000 ; /* default timeout = 1000 ms = 1 s */
208
210
#ifdef HAVE_PCAP_SET_IMMEDIATE_MODE
209
211
static int immediate_mode ;
@@ -2014,7 +2016,11 @@ main(int argc, char **argv)
2014
2016
break ;
2015
2017
#endif
2016
2018
case 'z' :
2019
+ #if defined(HAVE_FORK ) || defined(HAVE_VFORK )
2017
2020
zflag = optarg ;
2021
+ #else
2022
+ warning ("-z ignored. Fork subprocess not implemented.\n" );
2023
+ #endif
2018
2024
break ;
2019
2025
2020
2026
case 'Z' :
@@ -3134,15 +3140,7 @@ compress_savefile(const char *filename)
3134
3140
_exit (S_ERR_HOST_PROGRAM );
3135
3141
#endif
3136
3142
}
3137
- #else /* HAVE_FORK && HAVE_VFORK */
3138
- static void
3139
- compress_savefile (const char * filename )
3140
- {
3141
- fprintf (stderr ,
3142
- "%s failed. Functionality not implemented under your system\n" ,
3143
- __func__ );
3144
- }
3145
- #endif /* HAVE_FORK && HAVE_VFORK */
3143
+ #endif /* HAVE_FORK || HAVE_VFORK */
3146
3144
3147
3145
static void
3148
3146
close_old_dump_file (struct dump_info * dump_info )
@@ -3152,11 +3150,13 @@ close_old_dump_file(struct dump_info *dump_info)
3152
3150
*/
3153
3151
pcap_dump_close (dump_info -> pdd );
3154
3152
3153
+ #if defined(HAVE_FORK ) || defined(HAVE_VFORK )
3155
3154
/*
3156
3155
* Compress the file we just closed, if the user asked for it.
3157
3156
*/
3158
3157
if (zflag != NULL )
3159
3158
compress_savefile (dump_info -> CurrentFileName );
3159
+ #endif
3160
3160
}
3161
3161
3162
3162
static void
0 commit comments