Skip to content

Commit da1331b

Browse files
committed
BUILD: tcp_sample: var_fc_counter defined but not used
var_fc_counter is not used on Illumos and emit a warning src/tcp_sample.c:291:12: warning: ‘var_fc_counter’ defined but not used [-Wunused-function] 291 | static int var_fc_counter(struct arg *args, char **err) | ^~~~~~~~~~~~~~ Let's add an ifdef to build it.
1 parent 079193e commit da1331b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/tcp_sample.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ static int val_fc_time_value(struct arg *args, char **err)
288288
* case, the argument is ignored and a warning is emitted. Returns 0 on error
289289
* and non-zero if OK.
290290
*/
291+
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
291292
static int var_fc_counter(struct arg *args, char **err)
292293
{
293294
if (args[0].type != ARGT_STOP) {
@@ -299,6 +300,7 @@ static int var_fc_counter(struct arg *args, char **err)
299300

300301
return 1;
301302
}
303+
#endif
302304

303305
/* Returns some tcp_info data if it's available. "dir" must be set to 0 if
304306
* the client connection is required, otherwise it is set to 1. "val" represents

0 commit comments

Comments
 (0)