eina: remove couple of warnings
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 5 Oct 2011 20:00:29 +0000 (20:00 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 5 Oct 2011 20:00:29 +0000 (20:00 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@63842 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/eina_file.c
src/lib/eina_xattr.c

index 3086f60..dac9d2e 100644 (file)
@@ -945,6 +945,13 @@ eina_file_open(const char *path, Eina_Bool shared)
        n->global_refcount = 0;
         n->length = file_stat.st_size;
         n->mtime = file_stat.st_mtime;
+#ifdef _STAT_VER_LINUX
+# if (defined __USE_MISC && defined st_mtime)
+        n->mtime_nsec = (unsigned long int)file_stat.st_mtim.tv_nsec;
+# else
+        n->mtime_nsec = (unsigned long int)file_stat.st_mtimensec;
+# endif
+#endif
         n->inode = file_stat.st_ino;
         n->refcount = 0;
         n->fd = fd;
index 6031da2..bd5b98e 100644 (file)
@@ -100,12 +100,12 @@ _eina_xattr_ls_iterator_free(Eina_Xattr_Iterator *it)
 EAPI Eina_Iterator *
 eina_xattr_ls(const char *file)
 {
+#ifdef HAVE_XATTR
    Eina_Xattr_Iterator *it;
    ssize_t length;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(file, NULL);
 
-#ifdef HAVE_XATTR
    length = listxattr(file, NULL, 0);
    if (length <= 0) return NULL;
 
@@ -129,12 +129,14 @@ eina_xattr_ls(const char *file)
    return &it->iterator;
 #else
    return NULL;
+   (void)file;
 #endif
 }
 
 EAPI void *
 eina_xattr_get(const char *file, const char *attribute, ssize_t *size)
 {
+#ifdef HAVE_XATTR
    void *ret = NULL;
    ssize_t tmp;
 
@@ -142,7 +144,6 @@ eina_xattr_get(const char *file, const char *attribute, ssize_t *size)
    EINA_SAFETY_ON_NULL_RETURN_VAL(attribute, NULL);
    EINA_SAFETY_ON_TRUE_RETURN_VAL(!size, NULL);
 
-#ifdef HAVE_XATTR
    *size = getxattr(file, attribute, NULL, 0);
    /* Size should be less than 2MB (already huge in my opinion) */
    if (!(*size > 0 && *size < 2 * 1024 * 1024))
@@ -159,14 +160,21 @@ eina_xattr_get(const char *file, const char *attribute, ssize_t *size)
 
  on_error:
    free(ret);
-#endif
    *size = 0;
    return NULL;
+#else
+   EINA_SAFETY_ON_TRUE_RETURN_VAL(!size, NULL);
+   *size = 0;
+   return NULL;
+   (void)file;
+   (void)attribute;
+#endif
 }
 
 EAPI Eina_Bool
 eina_xattr_set(const char *file, const char *attribute, const void *data, ssize_t length, Eina_Xattr_Flags flags)
 {
+#ifdef HAVE_XATTR
    int iflags;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE);
@@ -174,7 +182,6 @@ eina_xattr_set(const char *file, const char *attribute, const void *data, ssize_
    EINA_SAFETY_ON_NULL_RETURN_VAL(data, EINA_FALSE);
    EINA_SAFETY_ON_TRUE_RETURN_VAL(!(length > 0 && length < 2 * 1024 * 1024), EINA_FALSE);
 
-#ifdef HAVE_XATTR
    switch (flags)
      {
      case EINA_XATTR_INSERT: iflags = 0; break;
@@ -189,6 +196,11 @@ eina_xattr_set(const char *file, const char *attribute, const void *data, ssize_
    return EINA_TRUE;
 #else
    return EINA_FALSE;
+   (void)file;
+   (void)attribute;
+   (void)data;
+   (void)length;
+   (void)flags;
 #endif
 }