[gentoo-commits] repo/gentoo:master commit in: net-ftp/linksys-tftp/, net-ftp/linksys-tftp/files/

2024-04-28 Thread Viorel Munteanu
commit: 9041943e464b5d219db2101df1eebcab907e4b60
Author: NHOrus  yahoo  com>
AuthorDate: Wed Apr 24 10:59:21 2024 +
Commit: Viorel Munteanu  gentoo  org>
CommitDate: Mon Apr 29 05:18:39 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9041943e

net-ftp/linksys-tftp: Port to C99, fix compile on musl systems

Primary patch by Richard Narron from bug 928051
Musl fix by me.

Closes: https://bugs.gentoo.org/928051
Closes: https://bugs.gentoo.org/714212
Closes: https://bugs.gentoo.org/874582
Closes: https://bugs.gentoo.org/885699
Closes: https://bugs.gentoo.org/913577
Signed-off-by: NHOrus  yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/36399
Signed-off-by: Viorel Munteanu  gentoo.org>

 .../files/linksys-tftp-1.2.1-r4-c99-port.patch | 572 +
 net-ftp/linksys-tftp/linksys-tftp-1.2.1-r4.ebuild  |  31 ++
 2 files changed, 603 insertions(+)

diff --git a/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r4-c99-port.patch 
b/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r4-c99-port.patch
new file mode 100644
index ..b4db3d2df8b0
--- /dev/null
+++ b/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r4-c99-port.patch
@@ -0,0 +1,572 @@
+Following patches are by Richard Narron from https://bugs.gentoo.org/928051
+--- linksys-tftp-1.2.1/tftpsubs.c  2024-04-16 08:27:50.310449884 -0700
 linksys-tftp-1.2.1/tftpsubs.c  2024-04-16 08:53:26.084521570 -0700
+@@ -38,6 +38,7 @@ static char sccsid[] = "@(#)tftpsubs.c   5
+ // modified tftp header to include pass
+ #include 
+ #include 
++#include 
+ 
+ #define PKTSIZE (1432+4) /* SEGSIZE+4 */  /* should be moved to tftp.h */
+ 
+@@ -60,14 +61,22 @@ static int current; /* index of buff
+ int newline = 0;/* fillbuf: in middle of newline expansion */
+ int prevchar = -1;  /* putbuf: previous char (cr check) */
+ 
+-struct tftphdr *rw_init();
++/* functions declared in this program */
++struct tftphdr *w_init();
++struct tftphdr *r_init();
++struct tftphdr *rw_init(int x);
++int readit(FILE *file,  struct tftphdr **dpp, int convert);
++int read_ahead(FILE *file, int convert);
++int writeit(FILE *file, struct tftphdr **dpp, int ct, int convert);
++int write_behind( FILE *file, int convert);
++int synchnet(intf);
+ 
+ struct tftphdr *w_init() { return rw_init(0); } /* write-behind */
+ struct tftphdr *r_init() { return rw_init(1); } /* read-ahead */
+ 
+-struct tftphdr *
+-rw_init(x)  /* init for either read-ahead or write-behind */
+-int x;  /* zero for write-behind, one for read-head */
++/* init for either read-ahead or write-behind */
++struct tftphdr *rw_init(int x)
++ /* zero for write-behind, one for read-head */
+ {
+   newline = 0;/* init crlf flag */
+   prevchar = -1;
+@@ -82,10 +91,8 @@ int x;  /* zero for writ
+ /* Have emptied current buffer by sending to net and getting ack.
+Free it and return next buffer filled with data.
+  */
+-readit(file, dpp, convert)
+-  FILE *file; /* file opened for read */
+-  struct tftphdr **dpp;
+-  int convert;/* if true, convert to ascii */
++int readit(FILE *file,  struct tftphdr **dpp, int convert)
++/* file opened for read   if true, convert to ascii */
+ {
+   struct bf *b;
+ 
+@@ -104,9 +111,9 @@ readit(file, dpp, convert)
+  * fill the input buffer, doing ascii conversions if requested
+  * conversions are  lf -> cr,lf  and cr -> cr, nul
+  */
+-read_ahead(file, convert)
+-  FILE *file; /* file opened for read */
+-  int convert;/* if true, convert to ascii */
++int read_ahead(FILE *file, int convert)  
++  /* file opened for read */
++  /* if true, convert to ascii */
+ {
+   register int i;
+   register char *p;
+@@ -154,16 +161,14 @@ read_ahead(file, convert)
+  *p++ = c;
+   }
+   b->counter = (int)(p - dp->th_data);
++return 0;
+ }
+ 
+ /* Update count associated with the buffer, get new buffer
+from the queue.  Calls write_behind only if next buffer not
+available.
+  */
+-writeit(file, dpp, ct, convert)
+-  FILE *file;
+-  struct tftphdr **dpp;
+-  int convert;
++int writeit(FILE *file, struct tftphdr **dpp, int ct, int convert)
+ {
+   bfs[current].counter = ct;  /* set size of data to write */
+   current = !current; /* switch to other buffer */
+@@ -180,9 +185,7 @@ writeit(file, dpp, ct, convert)
+  * Note spec is undefined if we get CR as last byte of file or a
+  * CR followed by anything else.  In this case we leave it alone.
+  */
+-write_behind(file, convert)
+-  FILE *file;
+-  int convert;
++int write_behind( FILE *file, int convert)
+ {
+   char *buf;
+   int count;
+@@ -238,9 +241,8 @@ skipit:
+  * when trace is active).
+  */
+ 
+-int
+-synchnet(f)
+-int 

[gentoo-commits] repo/gentoo:master commit in: net-ftp/linksys-tftp/, net-ftp/linksys-tftp/files/

2015-08-17 Thread Mike Frysinger
commit: 0edd0d07050437cff3bc2b9c48138a1c05eb
Author: Mike Frysinger vapier AT gentoo DOT org
AuthorDate: Mon Aug 17 12:47:25 2015 +
Commit: Mike Frysinger vapier AT gentoo DOT org
CommitDate: Mon Aug 17 12:48:07 2015 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0edd0444

net-ftp/linksys-tftp: refresh  apply header patch

This was queued a while ago but never actually applied.
Add it and update the patch to fix a few more files.

 .../files/linksys-tftp-1.2.1-r1-header.patch   | 36 --
 net-ftp/linksys-tftp/linksys-tftp-1.2.1-r3.ebuild  |  1 +
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r1-header.patch 
b/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r1-header.patch
index 386cf7b..9944f3c 100644
--- a/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r1-header.patch
+++ b/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r1-header.patch
@@ -1,11 +1,13 @@
 --- linksys-tftp-1.2.1/main.c
 +++ linksys-tftp-1.2.1/main.c
-@@ -40,6 +40,8 @@
+@@ -40,6 +40,10 @@
  #include setjmp.h
  #include ctype.h
  #include netdb.h
 +#include stdlib.h
-+#include strings.h
++#include string.h
++#include unistd.h
++#include sys/sendfile.h
  
  #define   TIMEOUT 5   /* secs between rexmt's */
  
@@ -18,3 +20,33 @@
char *argv[];
  {
struct sockaddr_in sin;
+--- a/tftp.c
 b/tftp.c
+@@ -36,8 +36,8 @@
+ #include stdio.h
+ #include errno.h
+ #include setjmp.h
+-
+-externint errno;
++#include string.h
++#include unistd.h
+ 
+ extern  struct sockaddr_in sin; /* filled in by main */
+ extern  int f;  /* the opened socket */
+@@ -69,16 +69,6 @@ void timer(int sig)
+   longjmp(timeoutbuf, 1);
+ }
+ 
+-strnlen(s, n)
+-  char *s;
+-  int n;
+-{
+-  int i = 0;
+-
+-  while (n--  0  *s++) i++;
+-  return(i);
+-}
+-
+ /*
+  * Parse an OACK package and set blocksize accordingly
+  */

diff --git a/net-ftp/linksys-tftp/linksys-tftp-1.2.1-r3.ebuild 
b/net-ftp/linksys-tftp/linksys-tftp-1.2.1-r3.ebuild
index 4b23797..8b635d4 100644
--- a/net-ftp/linksys-tftp/linksys-tftp-1.2.1-r3.ebuild
+++ b/net-ftp/linksys-tftp/linksys-tftp-1.2.1-r3.ebuild
@@ -16,6 +16,7 @@ KEYWORDS=amd64 ~ppc x86
 IUSE=
 
 src_prepare() {
+   epatch ${FILESDIR}/${P}-r1-header.patch
epatch ${FILESDIR}/${P}-r1-Makefile.patch
 }