summaryrefslogtreecommitdiff
path: root/net/freenet-tools/patches/patch-aa
diff options
context:
space:
mode:
Diffstat (limited to 'net/freenet-tools/patches/patch-aa')
-rw-r--r--net/freenet-tools/patches/patch-aa289
1 files changed, 253 insertions, 36 deletions
diff --git a/net/freenet-tools/patches/patch-aa b/net/freenet-tools/patches/patch-aa
index 62e86f0d55c..e50c4938a85 100644
--- a/net/freenet-tools/patches/patch-aa
+++ b/net/freenet-tools/patches/patch-aa
@@ -1,37 +1,254 @@
-$NetBSD: patch-aa,v 1.2 2004/10/29 17:06:50 tv Exp $
+$NetBSD: patch-aa,v 1.3 2006/05/16 18:02:04 tv Exp $
---- ftmain.c.orig Thu May 20 06:31:47 2004
-+++ ftmain.c
-@@ -218,9 +218,9 @@ void usage(int cmd)
- }
- }
-
--#ifdef __CYGWIN__
--/* The CYGWIN libc does not have a timegm() function */
--time_t cyg_timegm(struct tm *tm)
-+#if defined(__CYGWIN__) || defined(__INTERIX)
-+/* Replacement timegm() function for libc's missing it */
-+time_t timegm(struct tm *tm)
- {
- time_t time_temp;
- struct tm *tm_temp;
-@@ -234,7 +234,9 @@ time_t cyg_timegm(struct tm *tm)
- tm_temp = gmtime(&time_temp);
- return (time_t)(time_temp + (time_temp - mktime(tm_temp)));
- }
-+#endif
-
-+#ifdef __CYGWIN__
- ////////////////////////////////////////////////////////
- // private popen2() - in-fact this is exact copy of
- // newlib/libc/posix.c/popen.c with fork() instead of vfork()
-@@ -420,8 +422,7 @@ int main(int argc, char **argv)
- } else {
- progname = strdup(argv[0]);
- free(progpath);
-- progpath = calloc(256, 1);
-- getcwd(progpath, 256);
-+ progpath = FT_BIN;
- }
- ext = strrchr(progname, '.');
- if (NULL == ext) {
+--- ftfcp.c.orig 2005-06-24 08:57:55.000000000 -0400
++++ ftfcp.c
+@@ -235,7 +235,7 @@ int fcp_send_cmds(pid_t pid, fcp_t *f, c
+ for (i = 0, cmd = cmds; i < count; i++, cmd++) {
+ switch (cmd->type) {
+ case ARG_NONE:
+- rc = sk_printf(&f->conn, "%s\n", cmd->name);
++ rc = sk_printf(&f->conn, "%s\r\n", cmd->name);
+ if (0 != rc) {
+ LOG(L_ERROR,("{%d} sending command '%s' failed (%s)\n",
+ pid, cmd->name, strerror(errno)));
+@@ -252,7 +252,7 @@ int fcp_send_cmds(pid_t pid, fcp_t *f, c
+ LOG(L_DEBUG,("{%d} skip %s=%s\n", pid, cmd->name, arg));
+ break;
+ }
+- rc = sk_printf(&f->conn, "%s=%s\n", cmd->name, arg);
++ rc = sk_printf(&f->conn, "%s=%s\r\n", cmd->name, arg);
+ if (0 != rc) {
+ LOG(L_ERROR,("{%d} sending command '%s=%s' failed (%s)\n",
+ pid, cmd->name, arg, strerror(errno)));
+@@ -268,7 +268,7 @@ int fcp_send_cmds(pid_t pid, fcp_t *f, c
+ LOG(L_DEBUG,("{%d} skip %s=%s\n", pid, cmd->name, arg));
+ break;
+ }
+- rc = sk_printf(&f->conn, "%s=%s\n", cmd->name, arg);
++ rc = sk_printf(&f->conn, "%s=%s\r\n", cmd->name, arg);
+ if (0 != rc) {
+ LOG(L_ERROR,("{%d} sending command '%s=%s' failed (%s)\n",
+ pid, cmd->name, arg, strerror(errno)));
+@@ -277,7 +277,7 @@ int fcp_send_cmds(pid_t pid, fcp_t *f, c
+ LOG(L_DEBUG,("{%d} sent %s=%s\n", pid, cmd->name, arg));
+ break;
+ case ARG_STRING:
+- rc = sk_printf(&f->conn, "%s=%s\n", cmd->name, cmd->arg);
++ rc = sk_printf(&f->conn, "%s=%s\r\n", cmd->name, cmd->arg);
+ if (0 != rc) {
+ LOG(L_ERROR,("{%d} sending command '%s=%s' failed (%s)\n",
+ pid, cmd->name, cmd->arg, strerror(errno)));
+@@ -1309,52 +1309,52 @@ int fcp_put(fcp_t *f, const char *uri, i
+ }
+ LOG(L_DEBUG,("{%d} sent 00 00 00 02\n", pid));
+
+- if (0 != sk_printf(&f->conn, "ClientPut\n")) {
++ if (0 != sk_printf(&f->conn, "ClientPut\r\n")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent ClientPut\n", pid));
+
+ if (htl > 0) {
+- if (0 != sk_printf(&f->conn, "HopsToLive=%x\n", htl)) {
++ if (0 != sk_printf(&f->conn, "HopsToLive=%x\r\n", htl)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent HopsToLive=%x\n", pid, htl));
+ }
+
+- if (0 != sk_printf(&f->conn, "URI=%s\n", uri)) {
++ if (0 != sk_printf(&f->conn, "URI=%s\r\n", uri)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent URI=%s\n", pid, uri));
+
+ size = f->datasize + f->metasize;
+- if (0 != sk_printf(&f->conn, "DataLength=%x\n", size)) {
++ if (0 != sk_printf(&f->conn, "DataLength=%x\r\n", size)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent DataLength=%x\n", pid, size));
+
+ if (f->metasize > 0) {
+ size = f->metasize;
+- if (0 != sk_printf(&f->conn, "MetadataLength=%x\n", size)) {
++ if (0 != sk_printf(&f->conn, "MetadataLength=%x\r\n", size)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent MetadataLength=%x\n", pid, size));
+ }
+
+ if (0 != delete) {
+- if (0 != sk_printf(&f->conn, "RemoveLocalKey=%s\n", "yes")) {
++ if (0 != sk_printf(&f->conn, "RemoveLocalKey=%s\r\n", "yes")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent RemoveLocalKey=%s\n", pid, "yes"));
+ }
+
+ if (0 != meta_only) {
+- if (0 != sk_printf(&f->conn, "MetadataOnly=%s\n", "yes")) {
++ if (0 != sk_printf(&f->conn, "MetadataOnly=%s\r\n", "yes")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent MetadataOnly=%s\n", pid, "yes"));
+ }
+
+- if (0 != sk_printf(&f->conn, "Data\n")) {
++ if (0 != sk_printf(&f->conn, "Data\r\n")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent Data\n", pid));
+@@ -1465,13 +1465,13 @@ int fcp_chk(fcp_t *f)
+ }
+ LOG(L_DEBUG,("{%d} sent 00 00 00 02\n", pid));
+
+- if (0 != sk_printf(&f->conn, "GenerateCHK\n")) {
++ if (0 != sk_printf(&f->conn, "GenerateCHK\r\n")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent GenerateCHK\n", pid));
+
+ size = f->datasize + f->metasize;
+- if (0 != sk_printf(&f->conn, "DataLength=%x\n", size)) {
++ if (0 != sk_printf(&f->conn, "DataLength=%x\r\n", size)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent DataLength=%x\n",
+@@ -1479,12 +1479,12 @@ int fcp_chk(fcp_t *f)
+
+ if (f->metasize > 0) {
+ size = f->metasize;
+- if (0 != sk_printf(&f->conn, "MetadataLength=%x\n", size)) {
++ if (0 != sk_printf(&f->conn, "MetadataLength=%x\r\n", size)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent MetadataLength=%x\n", pid, size));
+ }
+- if (0 != sk_printf(&f->conn, "Data\n")) {
++ if (0 != sk_printf(&f->conn, "Data\r\n")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent Data\n", pid));
+@@ -1745,29 +1745,29 @@ int fcp_encode_segment(fcp_t *f, size_t
+ }
+ LOG(L_DEBUG,("{%d} sent 00 00 00 02\n", pid));
+
+- if (0 != sk_printf(&f->conn, "FECEncodeSegment\n")) {
++ if (0 != sk_printf(&f->conn, "FECEncodeSegment\r\n")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent FECEncodeSegment\n", pid));
+
+ #if 0
+- if (0 != sk_printf(&f->conn, "RequestedLists=\n")) {
++ if (0 != sk_printf(&f->conn, "RequestedLists=\r\n")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent RequestedList=\n", pid));
+ #endif
+- if (0 != sk_printf(&f->conn, "DataLength=%x\n", f->metasize + datalen)) {
++ if (0 != sk_printf(&f->conn, "DataLength=%x\r\n", f->metasize + datalen)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent DataLength=%x\n", pid, f->metasize + datalen));
+
+ #if 0 /* This is stupid, but the metadata size is not specified */
+- if (0 != sk_printf(&f->conn, "MetadataLength=%x\n", f->metasize)) {
++ if (0 != sk_printf(&f->conn, "MetadataLength=%x\r\n", f->metasize)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent MetadataLength=%x\n", pid, f->metasize));
+ #endif
+- if (0 != sk_printf(&f->conn, "Data\n")) {
++ if (0 != sk_printf(&f->conn, "Data\r\n")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent Data\n", pid));
+@@ -1907,22 +1907,22 @@ int fcp_segment_file(fcp_t **pf, const c
+ }
+ LOG(L_DEBUG,("{%d} sent 00 00 00 02\n", pid));
+
+- if (0 != sk_printf(&f->conn, "FECSegmentFile\n")) {
++ if (0 != sk_printf(&f->conn, "FECSegmentFile\r\n")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent FECSegmentFile\n", pid));
+
+- if (0 != sk_printf(&f->conn, "AlgoName=%s\n", algo_name)) {
++ if (0 != sk_printf(&f->conn, "AlgoName=%s\r\n", algo_name)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent AlgoName=%s\n", pid, algo_name));
+
+- if (0 != sk_printf(&f->conn, "FileLength=%x\n", file_length)) {
++ if (0 != sk_printf(&f->conn, "FileLength=%x\r\n", file_length)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent FileLength=%x\n", pid, file_length));
+
+- if (0 != sk_printf(&f->conn, "EndMessage\n")) {
++ if (0 != sk_printf(&f->conn, "EndMessage\r\n")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent EndMessage\n", pid));
+@@ -2013,32 +2013,32 @@ int fcp_broadcast(fcp_t *f, int htl,
+ }
+ LOG(L_DEBUG,("{%d} sent 00 00 00 02\n", pid));
+
+- if (0 != sk_printf(&f->conn, "ClientBroadcast\n")) {
++ if (0 != sk_printf(&f->conn, "ClientBroadcast\r\n")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent ClientBroadcast\n", pid));
+
+- if (0 != sk_printf(&f->conn, "HopsToLive=%x\n", htl)) {
++ if (0 != sk_printf(&f->conn, "HopsToLive=%x\r\n", htl)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent HopsToLive=%x\n", pid, htl));
+
+- if (0 != sk_printf(&f->conn, "Channel=%s\n", channel)) {
++ if (0 != sk_printf(&f->conn, "Channel=%s\r\n", channel)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent Channel=%s\n", pid, channel));
+
+- if (0 != sk_printf(&f->conn, "Sender=%s\n", sender)) {
++ if (0 != sk_printf(&f->conn, "Sender=%s\r\n", sender)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent Sender=%s\n", pid, sender));
+
+- if (0 != sk_printf(&f->conn, "Payload=%s\n", payload)) {
++ if (0 != sk_printf(&f->conn, "Payload=%s\r\n", payload)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent Payload=%s\n", pid, payload));
+
+- if (0 != sk_printf(&f->conn, "EndMessage\n")) {
++ if (0 != sk_printf(&f->conn, "EndMessage\r\n")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent EndMessage\n", pid));
+@@ -2101,17 +2101,17 @@ int fcp_receive(fcp_t *f, int id)
+ }
+ LOG(L_DEBUG,("{%d} sent 00 00 00 02\n", pid));
+
+- if (0 != sk_printf(&f->conn, "ClientReceive\n")) {
++ if (0 != sk_printf(&f->conn, "ClientReceive\r\n")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent ClientReceive\n", pid));
+
+- if (0 != sk_printf(&f->conn, "ID=%x\n", id)) {
++ if (0 != sk_printf(&f->conn, "ID=%x\r\n", id)) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent ID=%x\n", pid, id));
+
+- if (0 != sk_printf(&f->conn, "EndMessage\n")) {
++ if (0 != sk_printf(&f->conn, "EndMessage\r\n")) {
+ goto bailout;
+ }
+ LOG(L_DEBUG,("{%d} sent EndMessage\n", pid));