Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- src/shell-global.c.orig 2014-03-05 22:49:23.000000000 +0000
- +++ src/shell-global.c 2014-03-17 19:46:13.305294083 +0000
- @@ -33,7 +33,7 @@
- #include <malloc.h>
- #endif
- -#ifdef __OpenBSD__
- +#ifdef __OpenBSD__ || __FreeBSD__
- #include <sys/param.h>
- #include <sys/sysctl.h>
- #endif
- @@ -1138,9 +1138,13 @@
- g_warning ("failed to get /proc/self/cmdline: %s", error->message);
- return;
- }
- -#elif defined __OpenBSD__
- +#elif defined (__OpenBSD__) || defined (__FreeBSD__)
- int pid = getpid();
- +#if defined __OpenBSD__
- int mib[] = { CTL_KERN, KERN_PROC_ARGS, pid, KERN_PROC_ARGV };
- +#else
- + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_ARGS, pid };
- +#endif
- if (sysctl(mib, G_N_ELEMENTS (mib), &buf, &len, NULL, 0) == -1) {
- g_warning ("failed to get command line args: %d", errno);
- return;
Advertisement
Add Comment
Please, Sign In to add comment