Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \
-B build
cmake --build build
cmake --build build --target check

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Install static-analysis tools before running check

In the Linux/macOS matrix this new target now requires the check toolchain, but the job only installs gcc-multilib/libc6-dev-i386 for Ubuntu and has no macOS install step for cppcheck or clang-tidy; cmake/RunCheck.cmake exits fatally when either executable is missing. The current hosted macOS images do not list these tools, and Ubuntu does not list cppcheck, so these matrix entries can fail before reaching the tests unless the workflow installs/pins the analyzers before this line.

Useful? React with 👍 / 👎.

done
rm -rf build

Expand Down Expand Up @@ -234,6 +235,7 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \
-B build
cmake --build build
cmake --build build --target check

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add cppcheck to the FreeBSD VM setup

The FreeBSD job now invokes the check target, but its prepare step installs only gcc llvm sudo cmake; cmake/RunCheck.cmake treats a missing cppcheck executable as fatal. On these VM runs this newly added line will fail every FreeBSD compiler iteration before the tests unless cppcheck (and any needed unversioned clang-tidy) is installed or the target is gated.

Useful? React with 👍 / 👎.

done
rm -rf build

Expand Down
9 changes: 4 additions & 5 deletions src/limit_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,18 +187,17 @@ 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) {
/*
* Signal delivery failed. Common reasons:
* - 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;
Expand Down
6 changes: 1 addition & 5 deletions src/limiter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

/**
Expand Down
6 changes: 2 additions & 4 deletions src/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand All @@ -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);
}
2 changes: 1 addition & 1 deletion src/process_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}