aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-12-31 18:18:00 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-12-31 18:18:00 +0000
commit8ba0561e49183a1421e4eaf5f93d2551d48daae2 (patch)
treecf67aded3d5d4b813c28a9d9de2f4364ed846a58
parent66ebe6a3f8900173cd706dd03d22624f116b8205 (diff)
downloadefl-8ba0561e49183a1421e4eaf5f93d2551d48daae2.tar.gz
efl-8ba0561e49183a1421e4eaf5f93d2551d48daae2.tar.xz
efl-8ba0561e49183a1421e4eaf5f93d2551d48daae2.zip
efl: remove lstat and fchmod checks.
- fchmod() was isolated by HAVE_CHMOD, which was always present before... then fchmod() is also present as no errors were reported since its introduction. - fchmod() is POSIX for a while now. - lstat() is POSIX for a while now. - setxattr is supported by EFL_CHECK_FUNCS() as is used by eina. - splice() check added to EFL_CHECK_FUNCS() SVN revision: 81938
-rw-r--r--configure.ac69
-rw-r--r--m4/efl_check_funcs.m413
-rw-r--r--src/lib/eio/eio_file.c2
-rw-r--r--src/lib/eio/eio_single.c6
4 files changed, 15 insertions, 75 deletions
diff --git a/configure.ac b/configure.ac
index cc31fcae4..1c5f93f4d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3055,74 +3055,7 @@ EFL_ADD_LIBS([EIO], [-lm])
### Checks for linker characteristics
### Checks for library functions
-
-# Check for splice system call
-
-AC_MSG_CHECKING([whether to use splice for file copy])
-AC_TRY_LINK(
- [
-#if defined(HAVE_UNISTD_H)
-# include <unistd.h>
-#endif
-#include <fcntl.h>
- ],
- [
-long ret = splice(0,0,1,0,400,0);
- ],
- [have_splice="yes"],
- [have_splice="no"])
-AC_MSG_RESULT([${have_splice}])
-
-if test "x${have_splice}" = "xyes" ; then
- AC_DEFINE([HAVE_SPLICE], [1], [Define to mention that splice syscall is supported])
-fi
-
-# Check for lstat
-
-AC_MSG_CHECKING([whether lstat is available])
-AC_TRY_LINK(
- [
-#include <sys/types.h>
-#include <sys/stat.h>
-#if defined(HAVE_UNISTD_H)
-# include <unistd.h>
-#endif
- ],
- [
-struct stat st;
-lstat("/tmp", &st);
- ],
- [have_lstat="yes"],
- [have_lstat="no"])
-AC_MSG_RESULT([${have_lstat}])
-
-if test "x${have_lstat}" = "xyes" ; then
- AC_DEFINE([HAVE_LSTAT], [1], [Define to mention that lstat syscall is supported])
-fi
-
-# extended attribute
-
-AC_MSG_CHECKING([for extended attributes])
-
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/xattr.h>
- ]],
- [[
-size_t tmp = listxattr("/", NULL, 0);
-tmp = getxattr("/", "user.ethumb.md5", NULL, 0);
-setxattr("/", "user.ethumb.md5", NULL, 0, 0);
- ]])],
- [
- AC_DEFINE([HAVE_XATTR], [1], [Define to 1 if you have the `listxattr', `setxattr' and `getxattr' functions.])
- have_xattr="yes"
- ],
- [have_xattr="no"])
-
-AC_MSG_RESULT([${have_xattr}])
+EFL_CHECK_FUNCS([EIO], [splice setxattr])
EFL_LIB_END([Eio])
#### End of Eio
diff --git a/m4/efl_check_funcs.m4 b/m4/efl_check_funcs.m4
index f9319535f..035668537 100644
--- a/m4/efl_check_funcs.m4
+++ b/m4/efl_check_funcs.m4
@@ -207,6 +207,19 @@ int fd = shm_open("/dev/null", O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
]])
])
+dnl _EFL_CHECK_FUNC_SPLICE is for internal use
+dnl _EFL_CHECK_FUNC_SPLICE(EFL, VARIABLE)
+AC_DEFUN([_EFL_CHECK_FUNC_SPLICE],
+[EFL_FIND_LIB_FOR_CODE([$1], [], [$2], [[
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <fcntl.h>
+]], [[
+long ret = splice(0, 0, 1, 0, 400, 0);
+]])
+])
+
dnl Macro that checks function availability
dnl
dnl EFL_CHECK_FUNC(EFL, FUNCTION)
diff --git a/src/lib/eio/eio_file.c b/src/lib/eio/eio_file.c
index a7a8457de..50a8be24c 100644
--- a/src/lib/eio/eio_file.c
+++ b/src/lib/eio/eio_file.c
@@ -675,7 +675,7 @@ eio_file_copy_do(Ecore_Thread *thread, Eio_File_Progress *copy)
}
/* change access right to match source */
-#ifdef HAVE_CHMOD
+#ifdef HAVE_FCHMOD
if (fchmod(out, md) != 0)
goto on_error;
#else
diff --git a/src/lib/eio/eio_single.c b/src/lib/eio/eio_single.c
index 179f8be2e..6ffe6bcb3 100644
--- a/src/lib/eio/eio_single.c
+++ b/src/lib/eio/eio_single.c
@@ -151,7 +151,6 @@ _eio_file_stat(void *data, Ecore_Thread *thread)
_eio_file_struct_2_eina(&s->buffer, &buf);
}
-#ifdef HAVE_LSTAT
static void
_eio_file_lstat(void *data, Ecore_Thread *thread)
{
@@ -163,7 +162,6 @@ _eio_file_lstat(void *data, Ecore_Thread *thread)
_eio_file_struct_2_eina(&s->buffer, &buf);
}
-#endif
static void
_eio_stat_free(Eio_File_Stat *s)
@@ -447,7 +445,6 @@ eio_file_direct_lstat(const char *path,
Eio_Error_Cb error_cb,
const void *data)
{
-#ifdef HAVE_LSTAT
Eio_File_Stat *s = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
@@ -470,9 +467,6 @@ eio_file_direct_lstat(const char *path,
return NULL;
return &s->common;
-#else
- return eio_file_direct_stat(path, done_cb, error_cb, data);
-#endif
}
EAPI Eio_File *