forked from enlightenment/efl
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
This commit is contained in:
parent
66ebe6a3f8
commit
8ba0561e49
69
configure.ac
69
configure.ac
|
@ -3055,74 +3055,7 @@ EFL_ADD_LIBS([EIO], [-lm])
|
||||||
### Checks for linker characteristics
|
### Checks for linker characteristics
|
||||||
|
|
||||||
### Checks for library functions
|
### Checks for library functions
|
||||||
|
EFL_CHECK_FUNCS([EIO], [splice setxattr])
|
||||||
# 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_LIB_END([Eio])
|
EFL_LIB_END([Eio])
|
||||||
#### End of Eio
|
#### End of Eio
|
||||||
|
|
|
@ -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 Macro that checks function availability
|
||||||
dnl
|
dnl
|
||||||
dnl EFL_CHECK_FUNC(EFL, FUNCTION)
|
dnl EFL_CHECK_FUNC(EFL, FUNCTION)
|
||||||
|
|
|
@ -675,7 +675,7 @@ eio_file_copy_do(Ecore_Thread *thread, Eio_File_Progress *copy)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* change access right to match source */
|
/* change access right to match source */
|
||||||
#ifdef HAVE_CHMOD
|
#ifdef HAVE_FCHMOD
|
||||||
if (fchmod(out, md) != 0)
|
if (fchmod(out, md) != 0)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -151,7 +151,6 @@ _eio_file_stat(void *data, Ecore_Thread *thread)
|
||||||
_eio_file_struct_2_eina(&s->buffer, &buf);
|
_eio_file_struct_2_eina(&s->buffer, &buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LSTAT
|
|
||||||
static void
|
static void
|
||||||
_eio_file_lstat(void *data, Ecore_Thread *thread)
|
_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);
|
_eio_file_struct_2_eina(&s->buffer, &buf);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_eio_stat_free(Eio_File_Stat *s)
|
_eio_stat_free(Eio_File_Stat *s)
|
||||||
|
@ -447,7 +445,6 @@ eio_file_direct_lstat(const char *path,
|
||||||
Eio_Error_Cb error_cb,
|
Eio_Error_Cb error_cb,
|
||||||
const void *data)
|
const void *data)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LSTAT
|
|
||||||
Eio_File_Stat *s = NULL;
|
Eio_File_Stat *s = NULL;
|
||||||
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
|
||||||
|
@ -470,9 +467,6 @@ eio_file_direct_lstat(const char *path,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return &s->common;
|
return &s->common;
|
||||||
#else
|
|
||||||
return eio_file_direct_stat(path, done_cb, error_cb, data);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eio_File *
|
EAPI Eio_File *
|
||||||
|
|
Loading…
Reference in New Issue