opnsense-ports/cad/linuxcnc-devel/files/patch-src_rtapi_rtapi__uspace.hh
Franco Fichtner 82813a7fc7 */*: sync with upstream
Taken from: FreeBSD
2016-07-14 09:12:15 +02:00

24 lines
563 B
C++

--- src/rtapi/rtapi_uspace.hh.orig 2016-06-25 02:19:12 UTC
+++ src/rtapi/rtapi_uspace.hh
@@ -17,14 +17,21 @@
*/
#ifndef RTAPI_USPACE_HH
#define RTAPI_USPACE_HH
+#ifdef __linux__
#include <sys/fsuid.h>
+#endif
#include <unistd.h>
#include <pthread.h>
struct WithRoot
{
+#ifdef __linux__
WithRoot() { if(!level) setfsuid(geteuid()); level++; }
~WithRoot() { --level; if(!level) setfsuid(getuid()); }
+#else
+ WithRoot() { if(!level) level++; }
+ ~WithRoot() { --level; if(!level) seteuid(getuid()); }
+#endif
static int level;
};