OSDN Git Service

powerbtnd: include the header for string functions prototypes nougat-x86 android-x86-7.1-r1 android-x86-7.1-r2 android-x86-7.1-r3 android-x86-7.1-r4 android-x86-7.1-r5
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 15 Oct 2015 16:49:55 +0000 (00:49 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 8 Nov 2016 14:32:49 +0000 (22:32 +0800)
Also fixes a warning of mismatching argument.

power/powerbtnd.c

index f8fd656..855bdc8 100644 (file)
@@ -16,6 +16,7 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <dirent.h>
+#include <string.h>
 #include <cutils/log.h>
 #include <linux/input.h>
 #include <linux/uinput.h>
@@ -130,7 +131,7 @@ int main()
                                struct input_event iev;
                                size_t res = read(pfds[i].fd, &iev, sizeof(iev));
                                if (res < sizeof(iev)) {
-                                       ALOGW("insufficient input data(%d)? fd=%d", res, pfds[i].fd);
+                                       ALOGW("insufficient input data(%zd)? fd=%d", res, pfds[i].fd);
                                        continue;
                                }
                                ALOGD("type=%d scancode=%d value=%d from fd=%d", iev.type, iev.code, iev.value, pfds[i].fd);