diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5c1ee790..75a221d8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -160,6 +160,7 @@ jobs: -DCMAKE_BUILD_TYPE=Release \ -B build cmake --build build + cmake --build build --target check done rm -rf build @@ -234,6 +235,7 @@ jobs: -DCMAKE_BUILD_TYPE=Release \ -B build cmake --build build + cmake --build build --target check done rm -rf build diff --git a/src/limit_process.c b/src/limit_process.c index fe53e960..9456e7b7 100644 --- a/src/limit_process.c +++ b/src/limit_process.c @@ -187,9 +187,7 @@ static void send_signal_to_processes(struct process_group *proc_group, int sig, continue; } pid = ((const struct process *)node->data)->pid; - do { - kill_result = kill(pid, sig); - } while (kill_result != 0 && errno == EINTR); + kill_result = kill(pid, sig); if (kill_result != 0) { /* @@ -197,8 +195,9 @@ static void send_signal_to_processes(struct process_group *proc_group, int sig, * - ESRCH: Process no longer exists * - EPERM: Permission denied (rare in this context) * - * EINTR is transient and retried above, so all failures here - * indicate a process that can no longer be reliably controlled. + * kill() is non-blocking and cannot fail with EINTR, so any + * failure here indicates a process that can no longer be + * reliably controlled. * Save errno before any other calls that may clobber it. */ int saved_errno = errno; diff --git a/src/limiter.c b/src/limiter.c index aaa540c0..3a1cf609 100644 --- a/src/limiter.c +++ b/src/limiter.c @@ -98,7 +98,6 @@ */ static int is_script_inaccessible_interpreter(const char *path) { int fd; - int access_result; int saved_errno; char buf[256]; ssize_t n; @@ -147,10 +146,7 @@ static int is_script_inaccessible_interpreter(const char *path) { } /* Interpreter path is inaccessible -> report 126 */ - do { - access_result = access(p, F_OK); - } while (access_result != 0 && errno == EINTR); - return access_result != 0; + return access(p, F_OK) != 0; } /** diff --git a/src/list.c b/src/list.c index 5b729874..7c807f39 100644 --- a/src/list.c +++ b/src/list.c @@ -246,8 +246,7 @@ void clear_list(struct list *lst) { free(current_node); } /* Reset list to empty state */ - lst->first = lst->last = NULL; - lst->count = 0; + init_list(lst); } /** @@ -273,6 +272,5 @@ void destroy_list(struct list *lst) { free(current_node); } /* Reset list to empty state */ - lst->first = lst->last = NULL; - lst->count = 0; + init_list(lst); } diff --git a/src/process_table.c b/src/process_table.c index 557f745b..1c93fb46 100644 --- a/src/process_table.c +++ b/src/process_table.c @@ -256,7 +256,7 @@ void destroy_process_table(struct process_table *proc_table) { } } /* Free the bucket array itself */ - free((void *)proc_table->buckets); + free(proc_table->buckets); proc_table->buckets = NULL; proc_table->hash_size = 0; }