From 84cbece94eef57e82a77b7e1fd874dbbbd0d1b34 Mon Sep 17 00:00:00 2001 From: Kwangyoun Kim Date: Fri, 19 Apr 2013 16:33:35 +0900 Subject: [PATCH] Fix prevent issue Change-Id: I56dae1e6efb5d94dceeb173340690c962e94c368 --- server/ttsd_config_noti.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) mode change 100644 => 100755 server/ttsd_config_noti.c diff --git a/server/ttsd_config_noti.c b/server/ttsd_config_noti.c old mode 100644 new mode 100755 index c02d4fe..0a038ab --- a/server/ttsd_config_noti.c +++ b/server/ttsd_config_noti.c @@ -268,11 +268,10 @@ static Eina_Bool inotify_event_callback(void* data, Ecore_Fd_Handler *fd_handler SLOG(LOG_DEBUG, get_tag(), "===== [Config] Inotify event call"); int length; + char buffer[sizeof(struct inotify_event)]; + memset(buffer, 0, (sizeof(struct inotify_event))); - char buffer[sizeof(struct inotify_event) * BUFFER_SIZE]; - memset(buffer, 0, (sizeof(struct inotify_event) * BUFFER_SIZE)); - - length = read(g_fd_noti, buffer, (sizeof(struct inotify_event) * BUFFER_SIZE)); + length = read(g_fd_noti, buffer, (sizeof(struct inotify_event))); if (0 > length) { SLOG(LOG_ERROR, get_tag(), "[Config] Empty Inotify event"); SLOG(LOG_DEBUG, get_tag(), "====="); @@ -280,22 +279,13 @@ static Eina_Bool inotify_event_callback(void* data, Ecore_Fd_Handler *fd_handler return ECORE_CALLBACK_RENEW; } - FILE *fp; - - int i = 0; - while (i < length) { - char text[256]; - char msg[256]; - int uid, send_data; - - struct inotify_event *event = (struct inotify_event *)&buffer[i]; - i = i + sizeof(struct inotify_event) + event->len; + struct inotify_event *event; + event = (struct inotify_event *)&buffer; - if (IN_CLOSE_WRITE == event->mask) { - __ttsd_config_compare(); - } else { - SLOG(LOG_ERROR, get_tag(), "[Config] Undefined event"); - } + if (IN_CLOSE_WRITE == event->mask) { + __ttsd_config_compare(); + } else { + SLOG(LOG_ERROR, get_tag(), "[Config] Undefined event"); } SLOG(LOG_DEBUG, get_tag(), "====="); -- 2.7.4