summaryrefslogtreecommitdiffstats
path: root/ax25/axwrapper.c
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Kill assignments in if conditions.Ralf Baechle2017-07-311-1/+2
| | | | | | | | | | | | | | | | | | | | Somewhat hard to read and the code base already has many overlong lines. Found with below spatch file and some manual editing in ax25/access.c to restore a comment lost by spatch. @parens@ expression E, F, G; binary operator X; statement S; @@ - if ((E = F) X G) + E = F; + if (E X G) S Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axwrapper: Compute nfds argument of select() instead of using a constant.Ralf Baechle2017-07-261-1/+10
| | | | | | | In particular this remove reliance on how file descriptors are assigned and ensures we don't pass an unnecessarily high nfds argument to select. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axwrapper: Remove unused code resulting in warning.Ralf Baechle2017-07-261-7/+0
| | | | | | | | | | | | | | | | | gcc -g -O2 -Wall -o axspawn axspawn.o access.o md5.o -lax25 -lutil gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/us r/local/var/ax25/"\" -g -O2 -Wall -MT axwrapper.o -MD -MP -MF .deps/axwrapper.Tpo -c -o axwrapper.o axwrapper.c axwrapper.c:49:13: warning: ‘sigchld_handler’ defined but not used [-Wunused-function] static void sigchld_handler(int sig) ^~~~~~~~~~~~~~~ Since 71918b7d4e95 ("axwrapper: Mark functions sigchld_handler and convert_{cr_lf,lf_cr} static.") made sigchld_handler() static gcc was warning about the function being unused. No point in keeping this around; SIGCHLD is perfectly fine. Fixes: 71918b7d4e95 ("axwrapper: Mark functions sigchld_handler and convert_{cr_lf,lf_cr} static.") Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axwrapper: Handle EINTR error return from select().Ralf Baechle2017-07-261-0/+3
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axwrapper: Fix use of 0 instead of NULL as a pointer value.Ralf Baechle2017-02-061-1/+1
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axwrapper: Mark functions sigchld_handler and convert_{cr_lf,lf_cr} static.Ralf Baechle2017-02-061-3/+3
| | | | | | | | This results in a new warning about sigchld_handler() being unused which is because the caller is currently commented out which we leave to be sorted out later. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* ax25/axwrapper.c: Fix signedness compiler warnings.Ralf Baechle2015-06-071-1/+2
| | | | | | | | | | | | | | gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -g -O2 -Wall -MT axwrapper.o -MD -MP -MF .deps/axwrapper.Tpo -c -o axwrapper.o axwrapper.c axwrapper.c: In function ‘main’: axwrapper.c:105:17: warning: pointer targets in passing argument 2 of ‘setvbuf’ differ in signedness [-Wpointer-sign] setvbuf(stdout, stdoutbuf, _IOFBF, paclen); ^ In file included from axwrapper.c:36:0: /usr/include/stdio.h:336:12: note: expected ‘char * restrict’ but argument is of type ‘unsigned char *’ extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, ^ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axwrapper: Indent with tabs instead of spaces.Ralf Baechle2015-05-251-2/+2
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Add Tomi Manninen OH2BNS's axwrapper program.Ralf Baechle2015-05-251-0/+225
Axwrapper first creates a pipe and then forks and execs the program <server-program> with arguments given at the axwrapper command line. The argv[0] argument is mandatory; further arguments are optional. The parent process then sits and waits for any I/O to and from the user and converts any carriage return characters from the user to line feeds and any line feeds from the program to carriage returns. This is useful when starting non-AX.25-aware programs from ax25d. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>