termux-packages/packages/dictd/dictd.patch

109 lines
3.8 KiB
Diff
Raw Normal View History

diff -u -r ../dictd-1.12.1.orig/Makefile.in ./Makefile.in
--- ../dictd-1.12.1.orig/Makefile.in 2011-03-07 02:52:54.000000000 +0900
+++ ./Makefile.in 2018-02-08 18:50:15.790039388 +0900
@@ -123,7 +123,7 @@
%: %.o
$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -static \
- $^ $(OBJS) $(LDFLAGS) -lz ${LIBS}
+ $(^:.o=.lo) $(OBJS) $(LDFLAGS) -lz ${LIBS}
include $(srcdir)/deps
diff -u -r ../dictd-1.12.1.orig/dictd.c ./dictd.c
--- ../dictd-1.12.1.orig/dictd.c 2011-01-10 01:53:27.000000000 +0900
+++ ./dictd.c 2018-02-08 18:50:19.980039386 +0900
@@ -75,7 +75,7 @@
const char *logFile = NULL;
int logFile_set; /* 1 if set by command line option */
-const char *pidFile = "/var/run/dictd.pid";
+const char *pidFile = "@TERMUX_PREFIX@/var/run/dictd.pid";
int pidFile_set; /* 1 if set by command line option */
const char *daemon_service = DICT_DEFAULT_SERVICE;
Only in .: dictd.patch
diff -u -r ../dictd-1.12.1.orig/net.c ./net.c
--- ../dictd-1.12.1.orig/net.c 2010-08-22 02:55:40.000000000 +0900
+++ ./net.c 2018-02-08 18:50:22.640039385 +0900
@@ -65,7 +65,9 @@
{
struct hostent *hostEntry;
struct servent *serviceEntry;
+ /*
struct protoent *protocolEntry;
+ */
struct sockaddr_in ssin;
int s;
int hosts = 0;
@@ -79,8 +81,10 @@
} else if (!(ssin.sin_port = htons(atoi(service))))
return NET_NOSERVICE;
+ /*
if (!(protocolEntry = getprotobyname("tcp")))
return NET_NOPROTOCOL;
+ */
if ((hostEntry = gethostbyname(host))) {
++hosts;
@@ -92,7 +96,7 @@
memcpy( &ssin.sin_addr.s_addr, *current, hostEntry->h_length );
PRINTF(DBG_VERBOSE,
("Trying %s (%s)\n",host,inet_ntoa(ssin.sin_addr)));
- if ((s = socket(PF_INET, SOCK_STREAM, protocolEntry->p_proto)) < 0)
+ if ((s = socket(PF_INET, SOCK_STREAM, 6)) < 0)
err_fatal_errno( __func__, "Can't open socket on port %d\n",
ntohs(ssin.sin_port) );
if (connect(s, (struct sockaddr *)&ssin, sizeof(ssin)) >= 0)
@@ -100,7 +104,7 @@
close(s);
}
} else {
- if ((s = socket(PF_INET, SOCK_STREAM, protocolEntry->p_proto)) < 0)
+ if ((s = socket(PF_INET, SOCK_STREAM, 6)) < 0)
err_fatal_errno( __func__, "Can't open socket on port %d\n",
ntohs(ssin.sin_port) );
if (connect(s, (struct sockaddr *)&ssin, sizeof(ssin)) >= 0)
@@ -117,7 +121,9 @@
int queueLength)
{
struct servent *serviceEntry;
+ /*
struct protoent *protocolEntry;
+ */
struct sockaddr_in ssin;
int s;
const int one = 1;
@@ -131,10 +137,12 @@
} else if (!(ssin.sin_port = htons(atoi(service))))
err_fatal( __func__, "Can't get \"%s\" service entry\n", service );
+ /*
if (!(protocolEntry = getprotobyname("tcp")))
err_fatal( __func__, "Can't get \"tcp\" protocol entry\n" );
+ */
- if ((s = socket(PF_INET, SOCK_STREAM, protocolEntry->p_proto)) < 0)
+ if ((s = socket(PF_INET, SOCK_STREAM, 6)) < 0)
err_fatal_errno( __func__, "Can't open socket on port %d\n",
ntohs(ssin.sin_port) );
diff -u -r ../dictd-1.12.1.orig/parse.c ./parse.c
--- ../dictd-1.12.1.orig/parse.c 2008-12-08 01:50:05.000000000 +0900
+++ ./parse.c 2018-02-08 18:52:46.640039330 +0900
@@ -90,10 +90,9 @@
char *buffer;
const char **pt;
static const char *cpp = NULL;
- static const char *cpps[] = { "/lib/cpp",
- "/usr/lib/cpp",
- "/usr/ccs/lib/cpp", /* Solaris */
- "/usr/lang/cpp",
+ static const char *cpps[] = { "@TERMUX_PREFIX@/lib/cpp",
+ "@TERMUX_PREFIX@/ccs/lib/cpp", /* Solaris */
+ "@TERMUX_PREFIX@/lang/cpp",
0 };
static const char *extra_options = "";
FILE *tmp;