summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-04-03 13:34:04 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-04-03 13:34:04 +0000
commitf809c0a70684d7f5676f10836e1a31480270ff91 (patch)
tree8f73a2ea83d80bc1e532c6178b0aae002c9e618c /legacy
parent792801491e65604828639295843b527e32085e6f (diff)
eio: fix messy Xattr use.
SVN revision: 69898
Diffstat (limited to 'legacy')
-rw-r--r--legacy/eio/configure.ac24
-rw-r--r--legacy/eio/src/lib/eio_file.c14
-rw-r--r--legacy/eio/src/lib/eio_xattr.c4
3 files changed, 31 insertions, 11 deletions
diff --git a/legacy/eio/configure.ac b/legacy/eio/configure.ac
index f154c23b45..92ac8b59ec 100644
--- a/legacy/eio/configure.ac
+++ b/legacy/eio/configure.ac
@@ -225,6 +225,30 @@ if test "x${have_lstat}" = "xyes" ; then
225 AC_DEFINE([HAVE_LSTAT], [1], [Define to mention that lstat syscall is supported]) 225 AC_DEFINE([HAVE_LSTAT], [1], [Define to mention that lstat syscall is supported])
226fi 226fi
227 227
228# extended attribute
229
230AC_MSG_CHECKING([for extended attributes])
231
232AC_COMPILE_IFELSE(
233 [AC_LANG_PROGRAM(
234 [[
235#include <stdlib.h>
236#include <sys/types.h>
237#include <sys/xattr.h>
238 ]],
239 [[
240size_t tmp = listxattr("/", NULL, 0);
241tmp = getxattr("/", "user.ethumb.md5", NULL, 0);
242setxattr("/", "user.ethumb.md5", NULL, 0, 0);
243 ]])],
244 [
245 AC_DEFINE([HAVE_XATTR], [1], [Define to 1 if you have the `listxattr', `setxattr' and `getxattr' functions.])
246 have_xattr="yes"
247 ],
248 [have_xattr="no"])
249
250AC_MSG_RESULT([${have_xattr}])
251
228# Check for inotify specificity 252# Check for inotify specificity
229have_inotify="no" 253have_inotify="no"
230have_notify_win32="no" 254have_notify_win32="no"
diff --git a/legacy/eio/src/lib/eio_file.c b/legacy/eio/src/lib/eio_file.c
index e1f129ca63..f1a55794f4 100644
--- a/legacy/eio/src/lib/eio_file.c
+++ b/legacy/eio/src/lib/eio_file.c
@@ -244,11 +244,10 @@ _eio_file_direct_notify(void *data, Ecore_Thread *thread __UNUSED__, void *msg_d
244 } 244 }
245} 245}
246 246
247#ifdef HAVE_XATTR
248static void 247static void
249_eio_file_copy_xattr(Ecore_Thread *thread __UNUSED__, 248_eio_eina_file_copy_xattr(Ecore_Thread *thread __UNUSED__,
250 Eio_File_Progress *op __UNUSED__, 249 Eio_File_Progress *op __UNUSED__,
251 Eina_File *f, int out) 250 Eina_File *f, int out)
252{ 251{
253 Eina_Iterator *it; 252 Eina_Iterator *it;
254 Eina_Xattr *attr; 253 Eina_Xattr *attr;
@@ -256,11 +255,14 @@ _eio_file_copy_xattr(Ecore_Thread *thread __UNUSED__,
256 it = eina_file_xattr_value_get(f); 255 it = eina_file_xattr_value_get(f);
257 EINA_ITERATOR_FOREACH(it, attr) 256 EINA_ITERATOR_FOREACH(it, attr)
258 { 257 {
258#ifdef HAVE_XATTR
259 fsetxattr(out, attr->name, attr->value, attr->length, 0); 259 fsetxattr(out, attr->name, attr->value, attr->length, 0);
260#endif
260 } 261 }
261 eina_iterator_free(it); 262 eina_iterator_free(it);
262} 263}
263 264
265#ifdef HAVE_XATTR
264static void 266static void
265_eio_file_copy_xattr(Ecore_Thread *thread __UNUSED__, 267_eio_file_copy_xattr(Ecore_Thread *thread __UNUSED__,
266 Eio_File_Progress *op __UNUSED__, 268 Eio_File_Progress *op __UNUSED__,
@@ -661,9 +663,7 @@ eio_file_copy_do(Ecore_Thread *thread, Eio_File_Progress *copy)
661 goto on_error; 663 goto on_error;
662 } 664 }
663 665
664#ifdef HAVE_XATTR 666 _eio_eina_file_copy_xattr(thread, copy, f, out);
665 _eio_file_copy_eina_xattr(thread, copy, f, out);
666#endif
667 667
668 eina_file_close(f); 668 eina_file_close(f);
669 } 669 }
diff --git a/legacy/eio/src/lib/eio_xattr.c b/legacy/eio/src/lib/eio_xattr.c
index 1a904cdb2e..696028446d 100644
--- a/legacy/eio/src/lib/eio_xattr.c
+++ b/legacy/eio/src/lib/eio_xattr.c
@@ -20,10 +20,6 @@
20#include "eio_private.h" 20#include "eio_private.h"
21#include "Eio.h" 21#include "Eio.h"
22 22
23#ifdef HAVE_XATTR
24# include <sys/xattr.h>
25#endif
26
27/*============================================================================* 23/*============================================================================*
28 * Local * 24 * Local *
29 *============================================================================*/ 25 *============================================================================*/