Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/tnftp/src/main.c
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <time.h> | #include <time.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include <locale.h> | #include <locale.h> | ||||
#endif /* tnftp */ | #endif /* tnftp */ | ||||
#ifdef __FreeBSD__ | |||||
#include <sys/sysctl.h> | |||||
#endif | |||||
#define GLOBAL /* force GLOBAL decls in ftp_var.h to be declared */ | #define GLOBAL /* force GLOBAL decls in ftp_var.h to be declared */ | ||||
#include "ftp_var.h" | #include "ftp_var.h" | ||||
#define FTP_PROXY "ftp_proxy" /* env var with FTP proxy location */ | #define FTP_PROXY "ftp_proxy" /* env var with FTP proxy location */ | ||||
#define HTTP_PROXY "http_proxy" /* env var with HTTP proxy location */ | #define HTTP_PROXY "http_proxy" /* env var with HTTP proxy location */ | ||||
#define NO_PROXY "no_proxy" /* env var with list of non-proxied | #define NO_PROXY "no_proxy" /* env var with list of non-proxied | ||||
* hosts, comma or space separated */ | * hosts, comma or space separated */ | ||||
▲ Show 20 Lines • Show All 366 Lines • ▼ Show 20 Lines | #endif | ||||
setttywidth(0); | setttywidth(0); | ||||
#ifdef SIGINFO | #ifdef SIGINFO | ||||
(void)xsignal(SIGINFO, psummary); | (void)xsignal(SIGINFO, psummary); | ||||
#endif | #endif | ||||
(void)xsignal(SIGQUIT, psummary); | (void)xsignal(SIGQUIT, psummary); | ||||
(void)xsignal(SIGUSR1, crankrate); | (void)xsignal(SIGUSR1, crankrate); | ||||
(void)xsignal(SIGUSR2, crankrate); | (void)xsignal(SIGUSR2, crankrate); | ||||
(void)xsignal(SIGWINCH, setttywidth); | (void)xsignal(SIGWINCH, setttywidth); | ||||
auto_rcvbuf = ((sysctlbyname("net.inet.tcp.recvbuf_auto", | |||||
&auto_rcvbuf, &(size_t []){[0] = sizeof(int)}[0], NULL, 0) == 0) && | |||||
auto_rcvbuf == 1); | |||||
auto_sndbuf = ((sysctlbyname("net.inet.tcp.sendbuf_auto", | |||||
&auto_sndbuf, &(size_t []){[0] = sizeof(int)}[0], NULL, 0) == 0) && | |||||
auto_sndbuf == 1); | |||||
if (argc > 0) { | if (argc > 0) { | ||||
if (isupload) { | if (isupload) { | ||||
rval = auto_put(argc, argv, upload_path); | rval = auto_put(argc, argv, upload_path); | ||||
sigint_or_rval_exit: | sigint_or_rval_exit: | ||||
if (sigint_raised) { | if (sigint_raised) { | ||||
(void)xsignal(SIGINT, SIG_DFL); | (void)xsignal(SIGINT, SIG_DFL); | ||||
raise(SIGINT); | raise(SIGINT); | ||||
▲ Show 20 Lines • Show All 539 Lines • Show Last 20 Lines |