[FIX] redirect stderr to /dev/null 81/29681/1
authorVitaliy Cherepanov <v.cherepanov@samsung.com>
Fri, 31 Oct 2014 14:05:02 +0000 (17:05 +0300)
committerVitaliy Cherepanov <v.cherepanov@samsung.com>
Fri, 31 Oct 2014 14:05:02 +0000 (17:05 +0300)
Change-Id: I90c4658ca742a2170cbe070e6cdce44955b1e019
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
daemon/da_debug.c

index 5451844ec3cadcb1f6b79711ec8b2c25e6e8d0bd..74c3dbdc600444b289ac55462d7c0320e3164aac 100644 (file)
@@ -73,10 +73,21 @@ err_ret:
 
 int initialize_log(void)
 {
+       /* TODO fix problem with ecore and redirect stderr to DEBUG_LOGFILE back
+        *
+        * error sample
+        * *** IN FUNCTION: _ecore_main_fdh_epoll_mark_active()
+        * ERR<2328>:ecore ecore.c:572 _ecore_magic_fail()   Input handle has already been freed!
+        * ERR<2328>:ecore ecore.c:581 _ecore_magic_fail() *** NAUGHTY PROGRAMMER!!!
+        * *** SPANK SPANK SPANK!!!
+        *
+        */
        int ret = 0;
        int fd = open(DEBUG_LOGFILE, O_WRONLY | O_CREAT | O_TRUNC, 0777);
-       if (fd != -1) {
-               if (close_on_exec_dup(fd, 1) != 0 ||
+       int fd_null = open("/dev/null", O_WRONLY | O_CREAT | O_TRUNC, 0777);
+
+       if (fd != -1 && fd_null != -1) {
+               if (close_on_exec_dup(fd_null, 1) != 0 ||
                    close_on_exec_dup(fd, 2) != 0) {
                        LOGE("duplicate fd fail\n");
                        ret = -1;