From 2027db0a980fd179537bbce2cef6f29a57929c4b Mon Sep 17 00:00:00 2001 From: onelin Date: Sat, 5 Sep 2026 13:33:18 +0200 Subject: Open files with CLOEXEC --- Makefile | 5 +++++ main.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2709a32..c3842ee 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,7 @@ +.PHONY: check + frontend: main.c clang -g -Og -O0 -Wall -Werror -pedantic -Wextra -std=c99 -lc main.c -o frontend + +check: frontend + clang-tidy -checks=* main.c -- -std=c99 diff --git a/main.c b/main.c index aafad09..616bd80 100644 --- a/main.c +++ b/main.c @@ -66,7 +66,7 @@ main(int argc, char* argv[]) { Token_t* tokens = NULL; Location_t** lines = NULL; - f = fopen(argv[1], "r"); + f = fopen(argv[1], "re"); if (f == NULL) { fprintf(stdout, "! Failed to open file: %s\n", argv[1]); } -- cgit v1.3