gusibsd

Who said fear?

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