FreeBSD Bugzilla – Attachment 213132 Details for
Bug 245403
multimedia/obs-studio: Reimplement os_get_executable_path_ptr() with sysctl(3) as replacement of r530454
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
A patch to libobs/util/platform-nix.c
patch-libobs_util_platform-nix.c (text/plain), 1.04 KB, created by
Ka Ho Ng
on 2020-04-06 17:49:03 UTC
(
hide
)
Description:
A patch to libobs/util/platform-nix.c
Filename:
MIME Type:
Creator:
Ka Ho Ng
Created:
2020-04-06 17:49:03 UTC
Size:
1.04 KB
patch
obsolete
>diff --git libobs/util/platform-nix.c libobs/util/platform-nix.c >index d91ddd66..39388f5f 100644 >--- libobs/util/platform-nix.c >+++ libobs/util/platform-nix.c >@@ -40,6 +40,7 @@ > #include <sys/socket.h> > #include <sys/sysctl.h> > #include <sys/user.h> >+#include <sys/sysctl.h> > #include <unistd.h> > #include <libprocstat.h> > #else >@@ -275,7 +276,26 @@ char *os_get_program_data_path_ptr(const char *name) > char *os_get_executable_path_ptr(const char *name) > { > char exe[PATH_MAX]; >+#if defined(__FreeBSD__) || defined(__DragonFly__) >+ int sysctlname[4]; >+ size_t pathlen; >+ ssize_t count; >+ >+ sysctlname[0] = CTL_KERN; >+ sysctlname[1] = KERN_PROC; >+ sysctlname[2] = KERN_PROC_PATHNAME; >+ sysctlname[3] = -1; >+ >+ pathlen = PATH_MAX; >+ count = sysctl(sysctlname, nitems(sysctlname), exe, &pathlen, NULL, 0); >+ if (count == -1) { >+ blog(LOG_ERROR, "sysctl(KERN_PROC_PATHNAME) failed, errno %d", errno); >+ return NULL; >+ } >+ count = pathlen; >+#else > ssize_t count = readlink("/proc/self/exe", exe, PATH_MAX); >+#endif > const char *path_out = NULL; > struct dstr path; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 245403
:
213130
| 213132