Commit 305b89b
committed
fix(cli): add native FreeBSD self-executable path resolution
cbm_detect_self_path had no branch for FreeBSD, falling through to the
generic #else that reads /proc/self/exe. In this environment /proc is a
native FreeBSD procfs mount left empty (only /compat/linux/proc is
populated, for Linux-ABI processes under the compat layer), so the
readlink always failed silently and the function fell back to the
expected install path instead of the actual running binary's path.
This broke install: with no valid self path, the activation transaction
could never confirm what to publish and aborted early with
"activation transaction I/O failed" before attempting any linkat/rename.
Add sysctl(CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1) for FreeBSD,
matching the pattern already used in the test suites, and include
<sys/sysctl.h> guarded by __FreeBSD__.
Signed-off-by: Pedro Ramos <131530838+pr9000@users.noreply.github.com>1 parent d6be58e commit 305b89b
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
| |||
8913 | 8917 | | |
8914 | 8918 | | |
8915 | 8919 | | |
| 8920 | + | |
| 8921 | + | |
| 8922 | + | |
| 8923 | + | |
| 8924 | + | |
| 8925 | + | |
| 8926 | + | |
8916 | 8927 | | |
8917 | 8928 | | |
8918 | 8929 | | |
| |||
0 commit comments