From: pr.jung Date: Tue, 26 Sep 2017 09:02:37 +0000 (+0900) Subject: udev: Increase udev monitor buffer size X-Git-Tag: accepted/tizen/4.0/unified/20170927.045809^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f4724e04316bca4bcdc5515500bdf15b67da22c;p=platform%2Fcore%2Fsystem%2Fstoraged.git udev: Increase udev monitor buffer size Change-Id: Ieb3dffe9548530baa89c114c8ab5b9ac8c09cf52 Signed-off-by: pr.jung --- diff --git a/src/shared/fd_handler.c b/src/shared/fd_handler.c index 3c9fc11..b96345c 100644 --- a/src/shared/fd_handler.c +++ b/src/shared/fd_handler.c @@ -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"); diff --git a/src/shared/udev.c b/src/shared/udev.c index de5a927..113c6a6 100644 --- a/src/shared/udev.c +++ b/src/shared/udev.c @@ -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) {