merge with master tizen_2.1 2.1b_release 2.2_release accepted/tizen_2.1/20130425.024812 submit/tizen_2.1/20130424.233837 submit/tizen_2.2/20130714.144949
authorJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:19:24 +0000 (01:19 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:19:24 +0000 (01:19 +0900)
13 files changed:
AUTHORS
ChangeLog
NEWS
configure.ac
src/lib/Eio.h
src/lib/eio_eet.c
src/lib/eio_file.c
src/lib/eio_main.c
src/lib/eio_map.c
src/lib/eio_monitor.c
src/lib/eio_monitor_inotify.c
src/lib/eio_single.c
src/lib/eio_xattr.c

diff --git a/AUTHORS b/AUTHORS
index 27aeadc..733eaaa 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -6,3 +6,4 @@ Mikael SANS <sans.mikael@gmail.com>
 Mike Blumenkrantz (zmike/discomfitor) <michael.blumenkrantz@gmail.com>
 Jérôme Pinot <ngc891@gmail.com>
 Daniel Willmann <d.willmann@samsung.com>
+Jérémy Zurcher <jeremy@asynk.ch>
index bc42978..0f63fc4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        * Don't stop on limited access right.
 
 2012-10-03  Daniel Willmann
+
        * Fix memory corruption by allocating enough memory in
        eio_eet_data_read_cipher().
+
+2012-11-23 Sebastian Dransfeld
+
+       * Correctly define alloca
+       * Minor build fixes for solaris
+
+2012-12-07  Cedric Bail
+
+       * Don't leak fd on exec.
+    * Don't stop on limited access right.
+
+2012-12-07  Luis Felipe Strano Moraes
+
+       * 1.7.3 release
+
+2012-12-12  Mike Blumenkrantz
+
+        * Fixed crash in eio_monitor_del.
+
+2012-12-14  Cedric Bail
+
+       * Properly destroy fd on exec.
+
+2012-12-17 Vincent Torri
+
+       * Add XML output to doc
+       * Add installation rule for doc
+
+2012-12-21  Luis Felipe Strano Moraes
+
+       * 1.7.4 release
+
+2012-12-24  Mike Blumenkrantz
+
+        * eio functions no longer crash when passed NULL and throw errors accordingly
+
+2013-01-03  Jérémy Zurcher
+
+       * Add eio_eet_sync symbol.
+
+2013-01-04  Luis Felipe Strano Moraes
+
+       * 1.7.5 release
+
+2013-01-14  Cedric Bail
+
+       * Fix wrong initialization of container in eio_file_map_new.
diff --git a/NEWS b/NEWS
index 1fddc65..4dc74ff 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,45 @@
 Eio 1.8.0
 
+Eio 1.7.6
+
+Changes since Eio 1.7.5:
+------------------------
+
+Fixes:
+       * Fix wrongly set container in eio_file_map_new.
+
+Eio 1.7.5
+
+Changes since Eio 1.7.4:
+------------------------
+
+Add:
+       * Add eio_eet_sync symbol.
+
+Fixes:
+        * Functions no longer crash when passed NULL and throw errors accordingly
+
+Eio 1.7.4
+
+Changes since Eio 1.7.3:
+------------------------
+
+Fixes:
+        - Fixed crash in eio_monitor_del.
+       - Properly destroy fd on exec.
+
+Eio 1.7.3
+
+Changes since Eio 1.7.2:
+------------------------
+
+Fixes:
+       - Fix build on Solaris.
+       - Don't leak fd on exec.
+       - Don't stop on limited access right.
+
+Eio 1.7.2
+
 Changes since Eio 1.7.0:
 -------------------------
 
@@ -17,6 +57,10 @@ Removal:
 
 Eio 1.7.0
 
+Fixes:
+        - Fix memory corruption by allocating enough memory in
+        eio_eet_data_read_cipher().
+
 Changes since Eio 1.0.0:
 -------------------------
 
index 4f14a6a..e6ab424 100644 (file)
@@ -179,7 +179,7 @@ esac
 AC_SUBST(lt_enable_auto_import)
 
 ### Checks for library functions
-AC_CHECK_FUNCS([fchmod chown getpwnam getgrnam])
+AC_CHECK_FUNCS([fchmod chown getpwnam getgrnam fcntl])
 
 ### Check for splice system call
 
index cb791a0..6303b36 100644 (file)
@@ -953,7 +953,7 @@ EAPI Eio_File *eio_eet_close(Eet_File *ef,
  * @param data Unmodified user data passed to callbacks
  * @return NULL in case of a failure.
  *
- * This function will call eet_flush() from another thread. As long as the done_cb or
+ * This function will call eet_sync() from another thread. As long as the done_cb or
  * error_cb haven't be called, you must keep @p ef open.
  */
 EAPI Eio_File *eio_eet_sync(Eet_File *ef,
index 049c1e3..c0d36e0 100644 (file)
@@ -400,6 +400,15 @@ eio_eet_flush(Eet_File *ef,
 }
 
 EAPI Eio_File *
+eio_eet_sync(Eet_File *ef,
+             Eio_Done_Cb done_cb,
+             Eio_Eet_Error_Cb error_cb,
+             const void *data)
+{
+   return eio_eet_flush(ef,done_cb,error_cb,data);
+}
+
+EAPI Eio_File *
 eio_eet_data_write_cipher(Eet_File *ef,
                          Eet_Data_Descriptor *edd,
                          const char *name,
index 31122d0..cb7ddba 100644 (file)
@@ -869,6 +869,8 @@ eio_file_associate_add(Eio_File *ls,
                        const char *key,
                        const void *data, Eina_Free_Cb free_cb)
 {
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ls, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(key, EINA_FALSE);
    /* FIXME: Check if we are in the right worker thred */
    if (!ls->worker.associated)
      ls->worker.associated = eina_hash_string_small_new(eio_associate_free);
@@ -883,6 +885,8 @@ eio_file_associate_direct_add(Eio_File *ls,
                               const char *key,
                               const void *data, Eina_Free_Cb free_cb)
 {
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ls, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(key, EINA_FALSE);
    /* FIXME: Check if we are in the right worker thred */
    if (!ls->worker.associated)
      ls->worker.associated = eina_hash_string_small_new(eio_associate_free);
@@ -897,6 +901,8 @@ eio_file_associate_find(Eio_File *ls, const char *key)
 {
    Eio_File_Associate *search;
 
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ls, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(key, NULL);
    if (!ls->main.associated)
      return NULL;
 
index e65f75b..fa860be 100644 (file)
@@ -16,6 +16,7 @@
  * License along with this library;
  * if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "eio_private.h"
 #include "Eio.h"
 
index 9edc0ad..560f04b 100644 (file)
@@ -295,7 +295,7 @@ eio_file_map_new(Eina_File *f,
    map = malloc(sizeof (Eio_File_Map_Rule));
    EINA_SAFETY_ON_NULL_RETURN_VAL(map, NULL);
 
-   map->common.container = f;
+   map->file = f;
    map->filter_cb = filter_cb;
    map->map_cb = map_cb;
    map->rule = rule;
index 9f735d6..6dc0df3 100644 (file)
@@ -266,6 +266,7 @@ eio_monitor_add(const char *path)
    const char *tmp;
    Eio_Monitor *ret;
 
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
    tmp = eina_stringshare_add(path);
    ret = eio_monitor_stringshared_add(tmp);
    eina_stringshare_del(tmp);
@@ -278,6 +279,7 @@ eio_monitor_stringshared_add(const char *path)
    Eio_Monitor *monitor;
    struct stat st;
 
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
    if (_monitor_pid == -1) return NULL;
 
    if (_monitor_pid != getpid())
@@ -339,6 +341,7 @@ eio_monitor_stringshared_add(const char *path)
 EAPI void
 eio_monitor_del(Eio_Monitor *monitor)
 {
+   if (!monitor) return;
    EINA_REFCOUNT_UNREF(monitor)
      _eio_monitor_free(monitor);
 }
index b5ffabd..68d3d37 100644 (file)
@@ -184,11 +184,20 @@ _eio_inotify_handler(void *data __UNUSED__, Ecore_Fd_Handler *fdh)
 void eio_monitor_backend_init(void)
 {
    int fd;
+#ifdef HAVE_FCNTL
+   int flags;
+#endif
 
    fd = inotify_init();
    if (fd < 0)
      return ;
 
+#ifdef HAVE_FCNTL
+   flags = fcntl(fd, F_GETFD);
+   flags |= FD_CLOEXEC;
+   fcntl(fd, F_SETFD, flags);
+#endif
+
    _inotify_fdh = ecore_main_fd_handler_add(fd, ECORE_FD_READ, _eio_inotify_handler, NULL, NULL, NULL);
    if (!_inotify_fdh)
      {
index 8bc99fa..2666e69 100644 (file)
@@ -18,6 +18,7 @@
  * License along with this library;
  * if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "eio_private.h"
 #include "Eio.h"
 
@@ -417,8 +418,9 @@ eio_file_direct_stat(const char *path,
 {
    Eio_File_Stat *s = NULL;
 
-   if (!path || !done_cb || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    s = malloc(sizeof (Eio_File_Stat));
    if (!s) return NULL;
@@ -449,8 +451,9 @@ eio_file_direct_lstat(const char *path,
 #ifdef HAVE_LSTAT
    Eio_File_Stat *s = NULL;
 
-   if (!path || !done_cb || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    s = malloc(sizeof (Eio_File_Stat));
    if (!s) return NULL;
@@ -481,8 +484,9 @@ eio_file_unlink(const char *path,
 {
    Eio_File_Unlink *l = NULL;
 
-   if (!path || !done_cb || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    l = malloc(sizeof (Eio_File_Unlink));
    if (!l) return NULL;
@@ -510,8 +514,9 @@ eio_file_mkdir(const char *path,
 {
    Eio_File_Mkdir *r = NULL;
 
-   if (!path || !done_cb || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    r = malloc(sizeof (Eio_File_Mkdir));
    if (!r) return NULL;
@@ -540,8 +545,9 @@ eio_file_chmod(const char *path,
 {
    Eio_File_Mkdir *r = NULL;
 
-   if (!path || !done_cb || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    r = malloc(sizeof (Eio_File_Mkdir));
    if (!r) return NULL;
@@ -571,8 +577,9 @@ eio_file_chown(const char *path,
 {
    Eio_File_Chown *c = NULL;
 
-   if (!path || !done_cb || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    c = malloc(sizeof (Eio_File_Chown));
    if (!c) return NULL;
index cff21b9..6fbf6c4 100644 (file)
@@ -320,8 +320,10 @@ eio_file_xattr_get(const char *path,
 {
    Eio_File_Xattr *async;
 
-   if (!path || !attribute || !done_cb || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(attribute, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    async = malloc(sizeof (Eio_File_Xattr));
    if (!async) return NULL;
@@ -341,8 +343,10 @@ eio_file_xattr_string_get(const char *path,
 {
    Eio_File_Xattr *async;
 
-   if (!path || !attribute || !done_cb || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(attribute, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    async = malloc(sizeof (Eio_File_Xattr));
    if (!async) return NULL;
@@ -362,8 +366,10 @@ eio_file_xattr_double_get(const char *path,
 {
    Eio_File_Xattr *async;
 
-   if (!path || !attribute || !done_cb || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(attribute, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    async = malloc(sizeof (Eio_File_Xattr));
    if (!async) return NULL;
@@ -383,8 +389,10 @@ eio_file_xattr_int_get(const char *path,
 {
    Eio_File_Xattr *async;
 
-   if (!path || !attribute || !done_cb || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(attribute, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    async = malloc(sizeof (Eio_File_Xattr));
    if (!async) return NULL;
@@ -407,8 +415,12 @@ eio_file_xattr_set(const char *path,
 {
    Eio_File_Xattr *async;
 
-   if (!path || !attribute || !done_cb || !xattr_data || !xattr_size || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(attribute, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(xattr_data, NULL);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(xattr_size, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    async = malloc(sizeof (Eio_File_Xattr) + xattr_size);
    if (!async) return NULL;
@@ -433,8 +445,11 @@ eio_file_xattr_string_set(const char *path,
    Eio_File_Xattr *async;
    int length;
 
-   if (!path || !attribute || !done_cb || !xattr_string || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(attribute, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(xattr_string, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    async = malloc(sizeof (Eio_File_Xattr));
    if (!async) return NULL;
@@ -464,8 +479,10 @@ eio_file_xattr_double_set(const char *path,
 {
    Eio_File_Xattr *async;
 
-   if (!path || !attribute || !done_cb || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(attribute, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    async = malloc(sizeof (Eio_File_Xattr));
    if (!async) return NULL;
@@ -487,8 +504,10 @@ eio_file_xattr_int_set(const char *path,
 {
    Eio_File_Xattr *async;
 
-   if (!path || !attribute || !done_cb || !error_cb)
-     return NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(attribute, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
 
    async = malloc(sizeof (Eio_File_Xattr));
    if (!async) return NULL;