projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge with 1.11.1a
[gnulib.git]
/
lib
/
euidaccess.c
diff --git
a/lib/euidaccess.c
b/lib/euidaccess.c
index
1073c97
..
7bd317d
100644
(file)
--- a/
lib/euidaccess.c
+++ b/
lib/euidaccess.c
@@
-24,6
+24,18
@@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef S_IEXEC
+#ifndef S_IXUSR
+#define S_IXUSR S_IEXEC
+#endif
+#ifndef S_IXGRP
+#define S_IXGRP (S_IEXEC >> 3)
+#endif
+#ifndef S_IXOTH
+#define S_IXOTH (S_IEXEC >> 6)
+#endif
+#endif /* S_IEXEC */
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@
-47,7
+59,7
@@
gid_t getegid ();
#endif /* not POSIX_VERSION */
#include <errno.h>
#endif /* not POSIX_VERSION */
#include <errno.h>
-#ifndef
STDC_HEADERS
+#ifndef
errno
extern int errno;
#endif
extern int errno;
#endif
@@
-62,8
+74,6
@@
extern int errno;
#define R_OK 4
#endif
#define R_OK 4
#endif
-#include "safe-stat.h"
-
/* The user's real user id. */
static uid_t uid;
/* The user's real user id. */
static uid_t uid;
@@
-91,9
+101,9
@@
static int have_ids = 0;
int
eaccess_stat (statp, mode, path)
int
eaccess_stat (statp, mode, path)
- struct stat *statp;
+
const
struct stat *statp;
int mode;
int mode;
- char *path;
+ c
onst c
har *path;
{
int granted;
{
int granted;
@@
-146,7
+156,7
@@
eaccess_stat (statp, mode, path)
int
euidaccess (path, mode)
int
euidaccess (path, mode)
- char *path;
+ c
onst c
har *path;
int mode;
{
struct stat stats;
int mode;
{
struct stat stats;
@@
-165,7
+175,7
@@
euidaccess (path, mode)
return access (path, mode);
}
return access (path, mode);
}
- if (
SAFE_STAT
(path, &stats))
+ if (
stat
(path, &stats))
return -1;
return eaccess_stat (&stats, mode, path);
return -1;
return eaccess_stat (&stats, mode, path);