1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-25 12:15:32 +03:00
aports/community/sngrep/stdin-reopen-musl.patch
2019-04-07 07:08:10 +00:00

20 lines
624 B
Diff

diff --git a/src/capture.c b/src/capture.c
index 911c35f..2bcfc56 100644
--- a/src/capture.c
+++ b/src/capture.c
@@ -190,13 +190,14 @@ capture_offline(const char *infile, const char *outfile)
}
// Reopen tty for ncurses after pcap have used stdin
+ #ifdef __GLIBC__
if (!strncmp(infile, "/dev/stdin", 10)) {
if (!(stdin = freopen("/dev/tty", "r", stdin))) {
fprintf(stderr, "Failed to reopen tty while using stdin for capture.");
return 1;
}
}
-
+ #endif
// Get datalink to parse packets correctly
capinfo->link = pcap_datalink(capinfo->handle);