svace: Modify a strerror function to strerror_r to gurantee threads safety. 79/79579/1 submit/tizen/20160712.083906
authorJengHyun Kang <jhyuni.kang@samsung.com>
Tue, 12 Jul 2016 02:14:03 +0000 (11:14 +0900)
committerJengHyun Kang <jhyuni.kang@samsung.com>
Tue, 12 Jul 2016 02:14:03 +0000 (11:14 +0900)
Change-Id: Iacd31adb29bb284f93aa04597d5c6ca364e0616b

src/evdev.c

index 11fdb737a3d534d48a283eb2ef2ba9eb84666ed6..3872673efc3cf6d4981bfb34d391b64afa077869 100644 (file)
@@ -1763,12 +1763,14 @@ struct evdev_device *
 evdev_device_create(struct libinput_seat *seat,
                    struct udev_device *udev_device)
 {
+#define STRERR_BUFSIZE 256
        struct libinput *libinput = seat->libinput;
        struct evdev_device *device = NULL;
        int rc;
        int fd;
        int unhandled_device = 0;
        const char *devnode = udev_device_get_devnode(udev_device);
+       char buf[STRERR_BUFSIZE] = {0, };
 
        /* Use non-blocking mode so that we can loop on read on
         * evdev_device_data() until all events on the fd are
@@ -1777,7 +1779,7 @@ evdev_device_create(struct libinput_seat *seat,
        if (fd < 0) {
                log_info(libinput,
                         "opening input device '%s' failed (%s).\n",
-                        devnode, strerror(-fd));
+                        devnode, strerror_r(-fd, buf, STRERR_BUFSIZE));
                return NULL;
        }