From 2fac47f1c7ef8b4b92706811b2ec826705893249 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Thu, 6 Feb 2025 11:29:43 +0100 Subject: [PATCH] fix: exit when dup()ing stdin fails --- ethercat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ethercat.c b/ethercat.c index 0c38366..4cbbcc8 100644 --- a/ethercat.c +++ b/ethercat.c @@ -58,6 +58,7 @@ int main(int argc, char** argv) { stdin_dup = dup(fileno(stdin)); if (stdin_dup == -1) { fprintf(stderr, "Failed to dup() stdin: %s\n", strerror(errno)); + return EXIT_RUNTIME; } if (freopen(NULL, "wb", stdout) == NULL) {