Get the path where crash file is generated by using TZ_SYS_CRASH environment variable. 48/73248/1
authorshingil.kang <shingil.kang@samsung.com>
Tue, 7 Jun 2016 09:08:36 +0000 (18:08 +0900)
committershingil.kang <shingil.kang@samsung.com>
Tue, 7 Jun 2016 09:08:36 +0000 (18:08 +0900)
Change-Id: I954a722b617b90ed8741b6080ed7fa1d20365ee0
Signed-off-by: shingil.kang <shingil.kang@samsung.com>
src/services.c

index dc19c14..2672394 100644 (file)
@@ -264,7 +264,7 @@ void reboot_service(int fd, void *arg)
 #if !SDB_HOST
 #define EVENT_SIZE  ( sizeof (struct inotify_event) )
 #define BUF_LEN     ( 1024 * ( EVENT_SIZE + 16 ) )
-#define CS_PATH     tzplatform_mkpath(TZ_USER_SHARE,"crash/report")
+#define CS_PATH     tzplatform_getenv(TZ_SYS_CRASH)
 
 void inoti_service(int fd, void *arg)
 {
@@ -281,6 +281,12 @@ void inoti_service(int fd, void *arg)
     }
 
     wd = inotify_add_watch( ifd, CS_PATH, IN_CREATE);
+    if ( wd < 0 ) {
+        D("inotify_add_watch failed (errno :%d)\n", errno);
+        sdb_close(ifd);
+        sdb_close(fd);
+        return;
+    }
 
     for ( ; ; ) {
         int length, i = 0;