Changeset: 9aaac0aabaf5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9aaac0aabaf5
Modified Files:
        common/utils/mutils.c
        common/utils/mutils.h
        gdk/gdk_bbp.c
        monetdb5/mal/mal_linker.c
Branch: default
Log Message:

Cleanup: get rid of use of access system call.


diffs (77 lines):

diff --git a/common/utils/mutils.c b/common/utils/mutils.c
--- a/common/utils/mutils.c
+++ b/common/utils/mutils.c
@@ -667,17 +667,6 @@ MT_getcwd(char *buffer, size_t size)
        return len == -1 ? NULL : buffer;
 }
 
-int
-MT_access(const char *pathname, int mode)
-{
-       wchar_t *wpathname = utf8toutf16(pathname);
-       if (wpathname == NULL)
-               return -1;
-       int ret = _waccess(wpathname, mode);
-       free(wpathname);
-       return ret;
-}
-
 #else
 
 #if defined(HAVE_LOCKF) && defined(__MACH__)
diff --git a/common/utils/mutils.h b/common/utils/mutils.h
--- a/common/utils/mutils.h
+++ b/common/utils/mutils.h
@@ -56,7 +56,6 @@ mutils_export int MT_rename(const char *
 mutils_export int MT_remove(const char *filename);
 mutils_export int MT_mkdir(const char *dirname);
 mutils_export char *MT_getcwd(char *buffer, size_t size);
-mutils_export int MT_access(const char *pathname, int mode);
 
 #else
 
@@ -116,12 +115,6 @@ MT_getcwd(char *buffer, size_t size)
        return getcwd(buffer, size);
 }
 
-static inline int
-MT_access(const char *pathname, int mode)
-{
-       return access(pathname, mode);
-}
-
 #endif
 
 mutils_export uint16_t *utf8toutf16(const char *src);
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -73,9 +73,6 @@
 #include <fcntl.h>
 #endif
 
-#ifndef F_OK
-#define F_OK 0
-#endif
 #ifndef S_ISDIR
 #define S_ISDIR(mode)  (((mode) & _S_IFMT) == _S_IFDIR)
 #endif
diff --git a/monetdb5/mal/mal_linker.c b/monetdb5/mal/mal_linker.c
--- a/monetdb5/mal/mal_linker.c
+++ b/monetdb5/mal/mal_linker.c
@@ -58,13 +58,11 @@ static int lastfile = 0;
 /*
  * returns 1 if the file exists
  */
-#ifndef F_OK
-#define F_OK 0
-#endif
 static inline int
 fileexists(const char *path)
 {
-       return MT_access(path, F_OK) == 0;
+       struct stat stb;
+       return MT_stat(path, &stb) == 0;
 }
 
 /* Search for occurrence of the function in the library identified by the 
filename.  */
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to