summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2011-10-05 20:00:29 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2011-10-05 20:00:29 +0000
commit6ecdda512122eb5d405eb81434800875533ba21d (patch)
treeb1490cc32a67ad6fa1d7eaa2ecbc5aec9204cf74 /legacy
parent39f6f8579847c0f481ca435db658071badc4d4b5 (diff)
eina: remove couple of warnings
SVN revision: 63842
Diffstat (limited to 'legacy')
-rw-r--r--legacy/eina/src/lib/eina_file.c7
-rw-r--r--legacy/eina/src/lib/eina_xattr.c20
2 files changed, 23 insertions, 4 deletions
diff --git a/legacy/eina/src/lib/eina_file.c b/legacy/eina/src/lib/eina_file.c
index 3086f60749..dac9d2ecf0 100644
--- a/legacy/eina/src/lib/eina_file.c
+++ b/legacy/eina/src/lib/eina_file.c
@@ -945,6 +945,13 @@ eina_file_open(const char *path, Eina_Bool shared)
945 n->global_refcount = 0; 945 n->global_refcount = 0;
946 n->length = file_stat.st_size; 946 n->length = file_stat.st_size;
947 n->mtime = file_stat.st_mtime; 947 n->mtime = file_stat.st_mtime;
948#ifdef _STAT_VER_LINUX
949# if (defined __USE_MISC && defined st_mtime)
950 n->mtime_nsec = (unsigned long int)file_stat.st_mtim.tv_nsec;
951# else
952 n->mtime_nsec = (unsigned long int)file_stat.st_mtimensec;
953# endif
954#endif
948 n->inode = file_stat.st_ino; 955 n->inode = file_stat.st_ino;
949 n->refcount = 0; 956 n->refcount = 0;
950 n->fd = fd; 957 n->fd = fd;
diff --git a/legacy/eina/src/lib/eina_xattr.c b/legacy/eina/src/lib/eina_xattr.c
index 6031da25d8..bd5b98ed1b 100644
--- a/legacy/eina/src/lib/eina_xattr.c
+++ b/legacy/eina/src/lib/eina_xattr.c
@@ -100,12 +100,12 @@ _eina_xattr_ls_iterator_free(Eina_Xattr_Iterator *it)
100EAPI Eina_Iterator * 100EAPI Eina_Iterator *
101eina_xattr_ls(const char *file) 101eina_xattr_ls(const char *file)
102{ 102{
103#ifdef HAVE_XATTR
103 Eina_Xattr_Iterator *it; 104 Eina_Xattr_Iterator *it;
104 ssize_t length; 105 ssize_t length;
105 106
106 EINA_SAFETY_ON_NULL_RETURN_VAL(file, NULL); 107 EINA_SAFETY_ON_NULL_RETURN_VAL(file, NULL);
107 108
108#ifdef HAVE_XATTR
109 length = listxattr(file, NULL, 0); 109 length = listxattr(file, NULL, 0);
110 if (length <= 0) return NULL; 110 if (length <= 0) return NULL;
111 111
@@ -129,12 +129,14 @@ eina_xattr_ls(const char *file)
129 return &it->iterator; 129 return &it->iterator;
130#else 130#else
131 return NULL; 131 return NULL;
132 (void)file;
132#endif 133#endif
133} 134}
134 135
135EAPI void * 136EAPI void *
136eina_xattr_get(const char *file, const char *attribute, ssize_t *size) 137eina_xattr_get(const char *file, const char *attribute, ssize_t *size)
137{ 138{
139#ifdef HAVE_XATTR
138 void *ret = NULL; 140 void *ret = NULL;
139 ssize_t tmp; 141 ssize_t tmp;
140 142
@@ -142,7 +144,6 @@ eina_xattr_get(const char *file, const char *attribute, ssize_t *size)
142 EINA_SAFETY_ON_NULL_RETURN_VAL(attribute, NULL); 144 EINA_SAFETY_ON_NULL_RETURN_VAL(attribute, NULL);
143 EINA_SAFETY_ON_TRUE_RETURN_VAL(!size, NULL); 145 EINA_SAFETY_ON_TRUE_RETURN_VAL(!size, NULL);
144 146
145#ifdef HAVE_XATTR
146 *size = getxattr(file, attribute, NULL, 0); 147 *size = getxattr(file, attribute, NULL, 0);
147 /* Size should be less than 2MB (already huge in my opinion) */ 148 /* Size should be less than 2MB (already huge in my opinion) */
148 if (!(*size > 0 && *size < 2 * 1024 * 1024)) 149 if (!(*size > 0 && *size < 2 * 1024 * 1024))
@@ -159,14 +160,21 @@ eina_xattr_get(const char *file, const char *attribute, ssize_t *size)
159 160
160 on_error: 161 on_error:
161 free(ret); 162 free(ret);
162#endif
163 *size = 0; 163 *size = 0;
164 return NULL; 164 return NULL;
165#else
166 EINA_SAFETY_ON_TRUE_RETURN_VAL(!size, NULL);
167 *size = 0;
168 return NULL;
169 (void)file;
170 (void)attribute;
171#endif
165} 172}
166 173
167EAPI Eina_Bool 174EAPI Eina_Bool
168eina_xattr_set(const char *file, const char *attribute, const void *data, ssize_t length, Eina_Xattr_Flags flags) 175eina_xattr_set(const char *file, const char *attribute, const void *data, ssize_t length, Eina_Xattr_Flags flags)
169{ 176{
177#ifdef HAVE_XATTR
170 int iflags; 178 int iflags;
171 179
172 EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE); 180 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_
174 EINA_SAFETY_ON_NULL_RETURN_VAL(data, EINA_FALSE); 182 EINA_SAFETY_ON_NULL_RETURN_VAL(data, EINA_FALSE);
175 EINA_SAFETY_ON_TRUE_RETURN_VAL(!(length > 0 && length < 2 * 1024 * 1024), EINA_FALSE); 183 EINA_SAFETY_ON_TRUE_RETURN_VAL(!(length > 0 && length < 2 * 1024 * 1024), EINA_FALSE);
176 184
177#ifdef HAVE_XATTR
178 switch (flags) 185 switch (flags)
179 { 186 {
180 case EINA_XATTR_INSERT: iflags = 0; break; 187 case EINA_XATTR_INSERT: iflags = 0; break;
@@ -189,6 +196,11 @@ eina_xattr_set(const char *file, const char *attribute, const void *data, ssize_
189 return EINA_TRUE; 196 return EINA_TRUE;
190#else 197#else
191 return EINA_FALSE; 198 return EINA_FALSE;
199 (void)file;
200 (void)attribute;
201 (void)data;
202 (void)length;
203 (void)flags;
192#endif 204#endif
193} 205}
194 206