]> prime8.dev >> repos - ttyd.git/commitdiff
Avoid trying to redefine sys_signame on Android (#253)
authorFredrik Fornwall <fredrik@fornwall.net>
Fri, 13 Dec 2019 06:06:06 +0000 (07:06 +0100)
committerShuanglei Tao <tsl0922@gmail.com>
Fri, 13 Dec 2019 06:06:06 +0000 (14:06 +0800)
On Android <signal.h> defines sys_signame, so trying to redefine it
causes the build to fail.

src/utils.c

index bcb92bf6a2b082396094450452bdbbc12f73c5f9..4853456e8f9b8926ffd6c787a745b16a6daf6c00 100644 (file)
@@ -6,7 +6,7 @@
 #include <signal.h>
 #include <fcntl.h>
 
-#ifdef __linux__
+#if defined(__linux__) && !defined(__ANDROID__)
 // https://github.com/karelzak/util-linux/blob/master/misc-utils/kill.c
 const char *sys_signame[NSIG] = {
     "zero",  "HUP",  "INT",   "QUIT", "ILL",   "TRAP", "ABRT", "UNUSED",