summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--netsniff-ng.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/netsniff-ng.c b/netsniff-ng.c
index 331e476..a428996 100644
--- a/netsniff-ng.c
+++ b/netsniff-ng.c
@@ -950,23 +950,19 @@ static void recv_only_or_dump(struct ctx *ctx)
drop_privileges(ctx->enforce, ctx->uid, ctx->gid);
if (dump_to_pcap(ctx)) {
- __label__ try_file;
struct stat stats;
fmemset(&stats, 0, sizeof(stats));
ret = stat(ctx->device_out, &stats);
- if (ret < 0) {
+ if (ret < 0)
ctx->dump_dir = 0;
- goto try_file;
- }
+ else
+ ctx->dump_dir = S_ISDIR(stats.st_mode);
- ctx->dump_dir = S_ISDIR(stats.st_mode);
- if (ctx->dump_dir) {
+ if (ctx->dump_dir)
fd = begin_multi_pcap_file(ctx);
- } else {
- try_file:
+ else
fd = begin_single_pcap_file(ctx);
- }
}
printf("Running! Hang up with ^C!\n\n");