udev: Increase udev monitor buffer size 32/152532/1 accepted/tizen/4.0/unified/20170927.045809 submit/tizen_4.0/20170925.081537 submit/tizen_4.0/20170926.091805 submit/tizen_4.0/20170926.105700 submit/tizen_4.0/20170926.112655
authorpr.jung <pr.jung@samsung.com>
Tue, 26 Sep 2017 09:02:37 +0000 (18:02 +0900)
committerpr.jung <pr.jung@samsung.com>
Tue, 26 Sep 2017 09:02:37 +0000 (18:02 +0900)
Change-Id: Ieb3dffe9548530baa89c114c8ab5b9ac8c09cf52
Signed-off-by: pr.jung <pr.jung@samsung.com>
src/shared/fd_handler.c
src/shared/udev.c

index 3c9fc11..b96345c 100644 (file)
@@ -73,8 +73,14 @@ static gboolean channel_changed(GIOChannel *source,
        if (h->fd != g_io_channel_unix_get_fd(source))
                return TRUE;
 
-       if (condition != G_IO_IN)
+
+       if (condition & G_IO_ERR)
+               _E("udev_monitor_set_receive_buffer_size overflow");
+
+       if (!(condition & G_IO_IN)) {
+               _D("udev have a bad behavior");
                return TRUE;
+       }
 
        ret = true;
        if (h->changed)
@@ -110,7 +116,7 @@ int add_fd_read_handler(int fd,
                return -ENOMEM;
        }
 
-       id = g_io_add_watch(ch, G_IO_IN,
+       id = g_io_add_watch(ch, G_IO_IN | G_IO_ERR,
                        channel_changed, h);
        if (id == 0) {
                _E("Failed to add watch for GIOChannel");
index de5a927..113c6a6 100644 (file)
@@ -32,7 +32,7 @@
 
 #define SIGNAL_POWEROFF_STATE  "ChangeState"
 
-#define UDEV_MONITOR_SIZE   (10*1024)
+#define UDEV_MONITOR_SIZE   (100*1024)
 
 struct uevent_info {
        struct udev_monitor *mon;
@@ -131,6 +131,7 @@ static int uevent_control_start(const char *type,
                goto stop;
        }
 
+       _I("Set udev monitor buffer size %d", UDEV_MONITOR_SIZE);
        ret = udev_monitor_set_receive_buffer_size(info->mon,
                        UDEV_MONITOR_SIZE);
        if (ret != 0) {