Use POSIX macros for linux
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
#include <locale.h>
|
||||
#include <sys/param.h> /* for MAXPATHLEN and MAXHOSTNAMELEN */
|
||||
|
||||
#if defined(sun) || defined(linux)
|
||||
#if defined(sun) || defined(__linux__)
|
||||
#include <crypt.h>
|
||||
#include <shadow.h>
|
||||
#endif
|
||||
@@ -403,7 +403,7 @@ SetGidUid ( unsigned short rgid, unsigned short ruid )
|
||||
/* fix process gid */
|
||||
#if defined(SVR4) || defined(_AIX)
|
||||
setgid(rgid);
|
||||
#elif defined(linux) || defined(CSRG_BASED)
|
||||
#elif defined(__linux__) || defined(CSRG_BASED)
|
||||
if(-1 == setregid(rgid, rgid)) {
|
||||
fprintf(stderr, "SetGidUid: setregid failed on %d\n", rgid);
|
||||
}
|
||||
@@ -416,7 +416,7 @@ SetGidUid ( unsigned short rgid, unsigned short ruid )
|
||||
/* fix process uid */
|
||||
#if defined (SVR4) || defined (_AIX)
|
||||
setuid(ruid);
|
||||
#elif defined(linux) || defined(CSRG_BASED)
|
||||
#elif defined(__linux__) || defined(CSRG_BASED)
|
||||
if(-1 == setreuid(ruid, ruid)) {
|
||||
fprintf(stderr, "SetGidUid: setreuid failed on %d\n", ruid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user