merge with master accepted/tizen/20130607.213250 accepted/tizen/20130718.014438 accepted/tizen/20130829.155928 accepted/tizen/20130917.203647 submit/tizen/20130607.220729 submit/tizen/20130717.222813 submit/tizen/20130717.222839 submit/tizen/20130718.000643 submit/tizen/20130829.160330 submit/tizen/20130917.203825
authorJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:19:23 +0000 (01:19 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:19:23 +0000 (01:19 +0900)
ChangeLog
NEWS
configure.ac
packaging/eina.spec
src/include/eina_log.h
src/lib/eina_log.c
src/lib/eina_mmap.c

index b9f4e40..4d31bb6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
         * Fix return value of eina_mmap_safety_enabled_set() and
         ensure future eina_mmap_safety_enabled_get() return right value
         on success.
+
+2012-10-19  Patryk Kaczmarek
+
+       * eina_stringshare_add_length return NULL when func args are wrong.
+
+2012-10-20  Cedric Bail
+
+       1.7.1 release
+
+2012-11-23 Luis Felipe Strano Moraes
+
+        1.7.2 release
+
+2012-11-29  Vincent Torri
+
+        * Do not use -pthread anymore, but instead pass _REENTRANT to the
+       preprocessor and -lpthread to the linker.
+       * On Solaris OS, -mt is passed by default and same flags than
+       linux must be passed.
+
+2012-12-07  Cedric Bail
+
+       * Don't leak fd after exec.
+
+2012-12-07  Luis Felipe Strano Moraes
+
+       * 1.7.3 release
+
+2012-12-12  Nicolas Aguirre
+
+       * Fix define EINA_UNUSED for win32 builds
+
+2012-12-13  Lucas De Marchi
+
+    * Fix EINA_INLIST_FOREACH_SAFE macro
diff --git a/NEWS b/NEWS
index 595a06c..ba80942 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,21 @@
 Eina 1.8.0
 
+
+Eina 1.7.4
+
+Changes since Eina 1.7.3:
+-------------------------
+
+    * Fix EINA_INLIST_FOREACH_SAFE macro
+
+Eina 1.7.3
+
+Changes since Eina 1.7.2:
+-------------------------
+
+    * Fix Solaris build.
+    * Don't leak fd after exec.
+
 Changes since Eina 1.7.0:
 -------------------------
 
index 1011bec..a5a84cc 100644 (file)
@@ -324,6 +324,12 @@ PKG_CHECK_EXISTS([exotic],
 AM_CONDITIONAL([EINA_HAVE_EXOTIC], [test "x${enable_exotic}" = "xyes"])
 AC_SUBST([EINA_CONFIGURE_HAVE_EXOTIC])
 
+PKG_CHECK_EXISTS([dlog],
+   [
+    AC_DEFINE([HAVE_DLOG], [1], [Define to 1 if you have dlog.])
+    requirements_pc_eina="${requirements_pc_eina} dlog"
+   ])
+
 if ! test "x${requirements_pc_eina}" = "x" ; then
    PKG_CHECK_MODULES([EINA], [${requirements_pc_eina}])
 fi
index 3c0e4f9..99023c2 100644 (file)
@@ -1,11 +1,12 @@
 Name:       eina
 Summary:    Data Type Library
-Version:    1.7.1+svn.77445+build01r01
+Version:    1.7.1+svn.77445+build05r01
 Release:    1
 Group:      System/Libraries
 License:    LGPLv2
 URL:        http://www.enlightenment.org/
 Source0:    %{name}-%{version}.tar.gz
+BuildRequires:  pkgconfig(dlog)
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
index ea50c21..8d0d637 100644 (file)
@@ -891,6 +891,57 @@ EAPI void eina_log_print_cb_file(const Eina_Log_Domain *d,
                                  void                  *data,
                                  va_list                args);
 
+/*--- TIZEN_ONLY : begin ---*/
+/**
+ * Alternative logging method, this will output to system log
+ *
+ * @param d The domain.
+ * @param level Not used.
+ * @param file The file which is logged.
+ * @param fnc The function which is logged.
+ * @param line The line which is logged.
+ * @param fmt The ouptut format to use.
+ * @param data Not Used
+ * @param args The arguments needed by the format.
+ *
+ * This method will never output color.
+ *
+ */
+EAPI void eina_log_print_cb_syslog(const Eina_Log_Domain *d,
+                                   Eina_Log_Level         level,
+                                   const char            *file,
+                                   const char            *fnc,
+                                   int                    line,
+                                   const char            *fmt,
+                                   void                  *data,
+                                   va_list                args);
+
+#ifdef HAVE_DLOG
+/**
+ * Alternative logging method, this will output to dlog
+ *
+ * @param d The domain.
+ * @param level Not used.
+ * @param file The file which is logged.
+ * @param fnc The function which is logged.
+ * @param line The line which is logged.
+ * @param fmt The ouptut format to use.
+ * @param data Not Used
+ * @param args The arguments needed by the format.
+ *
+ */
+EAPI void eina_log_print_cb_dlog(const Eina_Log_Domain *d,
+                                 Eina_Log_Level         level,
+                                 const char            *file,
+                                 const char            *fnc,
+                                 int                    line,
+                                 const char            *fmt,
+                                 void                  *data,
+                                 va_list                args);
+#endif
+
+/*--- TIZEN_ONLY : end ---*/
+
 /**
  * Configure console color of given file.
  *
index f58163f..995df0a 100644 (file)
 #include <assert.h>
 #include <errno.h>
 
+/*--- TIZEN_ONLY : begin ---*/
+#include <syslog.h>
+
+#ifdef HAVE_DLOG
+# include <dlog.h>
+#  ifdef LOG_TAG
+#   undef LOG_TAG
+#  endif
+# define LOG_TAG "EFL"
+#endif
+/*--- TIZEN_ONLY : end ---*/
+
 #if defined HAVE_EXECINFO_H && defined HAVE_BACKTRACE && defined HAVE_BACKTRACE_SYMBOLS
 # include <execinfo.h>
 # define EINA_LOG_BACKTRACE
 #define EINA_LOG_ENV_FILE_DISABLE "EINA_LOG_FILE_DISABLE"
 #define EINA_LOG_ENV_FUNCTION_DISABLE "EINA_LOG_FUNCTION_DISABLE"
 #define EINA_LOG_ENV_BACKTRACE "EINA_LOG_BACKTRACE"
+/*--- TIZEN_ONLY : begin ---*/
+#define EINA_LOG_ENV_SYSLOG_ENABLE "EINA_LOG_SYSLOG_ENABLE"
+
+#ifdef HAVE_DLOG
+#define EINA_LOG_ENV_DLOG_ENABLE "EINA_LOG_DLOG_ENABLE"
+#endif
+/*--- TIZEN_ONLY : end ---*/
 
 #ifdef EINA_ENABLE_LOG
 
@@ -229,6 +248,7 @@ static size_t _log_domains_allocated = 0;
 
 // Default function for printing on domains
 static Eina_Log_Print_Cb _print_cb = eina_log_print_cb_stderr;
+
 static void *_print_cb_data = NULL;
 
 #ifdef DEBUG
@@ -1422,6 +1442,17 @@ eina_log_init(void)
    if ((tmp = getenv(EINA_LOG_ENV_ABORT_LEVEL)))
       _abort_level_on_critical = atoi(tmp);
 
+   /*--- TIZEN_ONLY : begin ---*/
+   if ((tmp = getenv(EINA_LOG_ENV_SYSLOG_ENABLE)) && (atoi(tmp) == 1))
+      _print_cb = eina_log_print_cb_syslog;
+
+#ifdef HAVE_DLOG
+   /* dlog has more higher priority than syslog */
+   if ((tmp = getenv(EINA_LOG_ENV_DLOG_ENABLE)) && (atoi(tmp) == 1))
+      _print_cb = eina_log_print_cb_dlog;
+#endif
+   /*--- TIZEN_ONLY : end ---*/
+
    eina_log_print_prefix_update();
 
    // Global log level
@@ -1981,6 +2012,153 @@ end:
 #endif
 }
 
+/*--- TIZEN_ONLY : begin ---*/
+EAPI void
+eina_log_print_cb_syslog(const Eina_Log_Domain *d,
+                         Eina_Log_Level level,
+                         const char *file,
+                         const char *fnc,
+                         int line,
+                         const char *fmt,
+                         __UNUSED__ void *data,
+                         va_list args)
+{
+#ifdef EINA_ENABLE_LOG
+   int priority;
+   const char buf[512];
+
+   switch (level)
+     {
+      case EINA_LOG_LEVEL_CRITICAL:
+         priority = LOG_CRIT;
+         break;
+      case EINA_LOG_LEVEL_ERR:
+         priority = LOG_ERR;
+         break;
+      case EINA_LOG_LEVEL_WARN:
+         priority = LOG_WARNING;
+         break;
+      case EINA_LOG_LEVEL_INFO:
+         priority = LOG_INFO;
+         break;
+      case EINA_LOG_LEVEL_DBG:
+         priority = LOG_DEBUG;
+         break;
+      default:
+         priority = level + LOG_CRIT;
+         break;
+     }
+
+   vsnprintf((char *)buf, sizeof(buf), fmt, args);
+
+   syslog(priority, "%s<%u> %s:%d %s() %s", d->name, eina_log_pid_get(),
+          file, line, fnc, buf);
+
+#ifdef EINA_LOG_BACKTRACE
+   if (EINA_UNLIKELY(level < _backtrace_level))
+     {
+        void *bt[256];
+        char **strings;
+        int btlen;
+        int i;
+
+        btlen = backtrace((void **)bt, 256);
+        strings = backtrace_symbols((void **)bt, btlen);
+        syslog(priority, "%s<%u> %s:%d %s() *** Backtrace ***", d->name,
+               eina_log_pid_get(), file, line, fnc);
+        for (i = 0; i < btlen; ++i)
+           syslog(priority, "%s<%u> %s:%d %s() %s", d->name,
+                  eina_log_pid_get(), file, line, fnc, strings[i]);
+        free(strings);
+     }
+#endif
+
+#else
+   (void) d;
+   (void) file;
+   (void) fnc;
+   (void) line;
+   (void) fmt;
+   (void) data;
+   (void) args;
+#endif
+}
+
+#ifdef HAVE_DLOG
+EAPI void
+eina_log_print_cb_dlog(const Eina_Log_Domain *d,
+                         Eina_Log_Level level,
+                         const char *file,
+                         const char *fnc,
+                         int line,
+                         const char *fmt,
+                         __UNUSED__ void *data,
+                         va_list args)
+{
+#ifdef EINA_ENABLE_LOG
+   int log_level;
+   const char buf[512];
+
+   switch (level)
+     {
+      case EINA_LOG_LEVEL_CRITICAL:
+         log_level = DLOG_FATAL;
+         break;
+      case EINA_LOG_LEVEL_ERR:
+         log_level = DLOG_ERROR;
+         break;
+      case EINA_LOG_LEVEL_WARN:
+         log_level = DLOG_WARN;
+         break;
+      case EINA_LOG_LEVEL_INFO:
+         log_level = DLOG_INFO;
+         break;
+      case EINA_LOG_LEVEL_DBG:
+         log_level = DLOG_DEBUG;
+         break;
+      default:
+         log_level = DLOG_VERBOSE;
+         break;
+     }
+
+   vsnprintf((char *)buf, sizeof(buf), fmt, args);
+
+   print_log(log_level, LOG_TAG, "%s<%u> %s:%d %s() %s", d->name,
+             eina_log_pid_get(), file, line, fnc, buf);
+
+#ifdef EINA_LOG_BACKTRACE
+   if (EINA_UNLIKELY(level < _backtrace_level))
+     {
+        void *bt[256];
+        char **strings;
+        int btlen;
+        int i;
+
+        btlen = backtrace((void **)bt, 256);
+        strings = backtrace_symbols((void **)bt, btlen);
+        print_log(log_level, LOG_TAG, "%s<%u> %s:%d %s() *** Backtrace ***",
+                  d->name, eina_log_pid_get(), file, line, fnc);
+        for (i = 0; i < btlen; ++i)
+           print_log(log_level, LOG_TAG, "%s<%u> %s:%d %s() %s", d->name,
+                     eina_log_pid_get(), file, line, fnc, strings[i]);
+        free(strings);
+     }
+#endif
+
+#else
+   (void) d;
+   (void) file;
+   (void) fnc;
+   (void) line;
+   (void) fmt;
+   (void) data;
+   (void) args;
+#endif
+}
+#endif
+
+/*--- TIZEN_ONLY : end ---*/
+
 EAPI void
 eina_log_print(int domain, Eina_Log_Level level, const char *file,
                const char *fnc, int line, const char *fmt, ...)
index 90809a2..1a43675 100644 (file)
@@ -156,9 +156,20 @@ eina_mmap_safety_enabled_set(Eina_Bool enabled)
         /* no zero page device - open it */
         if (_eina_mmap_zero_fd < 0)
           {
+#ifdef HAVE_EXECVP
+             int flags;
+#endif
+
              _eina_mmap_zero_fd = open("/dev/zero", O_RDWR);
              /* if we don;'t have one - fail to set up mmap safety */
              if (_eina_mmap_zero_fd < 0) return EINA_FALSE;
+
+#ifdef HAVE_EXECVP
+             flags = fcntl(_eina_mmap_zero_fd, F_GETFD);
+             flags |= FD_CLOEXEC;
+             fcntl(_eina_mmap_zero_fd, F_SETFD, flags);
+#endif
+            
           }
         /* set up signal handler for SIGBUS */
         sa.sa_sigaction = _eina_mmap_safe_sigbus;