sigchld_handler (int sig)
/* process SIGCHLD to obtain the exit code of the terminating process */
{
- extern volatile int lastsig; /* last signal received */
pid_t pid;
#if defined(HAVE_WAITPID) /* the POSIX way */
#include <hesiod.h>
#endif
+#include <langinfo.h>
+
#if defined(HAVE_RES_SEARCH) || defined(HAVE_GETHOSTBYNAME)
#include <netdb.h>
#include "mx.h"
int msg_to_send = FALSE;
struct idlist *head=NULL, *current=NULL;
int max_warning_poll_count;
- char *tmp;
head = ctl->skipped;
if (!head)
if (open_warning_by_mail(ctl, (struct msgblk *)NULL))
return;
stuff_warning(ctl,
- tmp = rfc2047e(
+ rfc2047e(
GT_("Subject: Fetchmail oversized-messages warning"), nl_langinfo(CODESET)));
stuff_warning(ctl, "");
stuff_warning(ctl,
extern char *getenv(const char *); /* needed on sysV68 R3V7.1. */
-extern char *program_name;
-
void envquery(int argc, char **argv)
/* set up basic stuff from the environment (including the rc file name) */
{
static RETSIGTYPE donothing(int sig)
{
- extern volatile int lastsig; /* declared in idle.c */
set_signal_handler(sig, donothing);
lastsig = sig;
}
int main(int argc, char **argv)
{
int bkgd = FALSE;
- int parsestatus, implicitmode = FALSE;
+ int implicitmode = FALSE;
struct query *ctl;
netrc_entry *netrc_list;
char *netrc_file, *tmpbuf;
}
#endif
- if ((parsestatus = parsecmdline(argc,argv, &cmd_run, &cmd_opts)) < 0)
+ if ((parsecmdline(argc,argv, &cmd_run, &cmd_opts)) < 0)
exit(PS_SYNTAX);
if (versioninfo)
GT_("fetchmail: can't find a password for %s@%s.\n"),
ctl->remotename, ctl->server.pollname);
return(PS_AUTHFAIL);
- }
- else
- {
- char* password_prompt = GT_("Enter password for %s@%s: ");
+ } else {
+ const char* password_prompt = GT_("Enter password for %s@%s: ");
xalloca(tmpbuf, char *, strlen(password_prompt) +
strlen(ctl->remotename) +
#include <stdio.h>
-/* We need this for time_t */
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
+/* We need this for strstr */
+#if !defined(HAVE_STRSTR) && !defined(strstr)
+char *strstr(const char *, const char *);
#endif
/* constants designating the various supported protocols */
/* idle.c */
int interruptible_idle(int interval);
+extern volatile int lastsig;
/* sink.c: forwarding */
void smtp_close(struct query *, int);
#include "i18n.h"
-#ifdef OPIE_ENABLE
-#endif /* OPIE_ENABLE */
-
-#ifndef strstr /* glibc-2.1 declares this as a macro */
-extern char *strstr(const char *, const char *); /* needed on sysV68 R3V7.1. */
-#endif /* strstr */
-
/* imap_version values */
#define IMAP2 -1 /* IMAP2 or IMAP2BIS, RFC1176 */
#define IMAP4 0 /* IMAP4 rev 0, RFC1730 */
#include <opie.h>
#endif /* OPIE_ENABLE */
-#ifndef strstr /* glibc-2.1 declares this as a macro */
-extern char *strstr(const char *, const char *); /* needed on sysV68 R3V7.1. */
-#endif /* strstr */
-
static int last;
#ifdef SDPS_ENABLE
char *sdps_envfrom;
#if defined(KERBEROS_V4) || defined(KERBEROS_V5)
flag has_kerberos = FALSE;
#endif /* defined(KERBEROS_V4) || defined(KERBEROS_V5) */
- flag has_cram = FALSE;
+ static flag has_cram = FALSE;
#ifdef OPIE_ENABLE
flag has_otp = FALSE;
#endif /* OPIE_ENABLE */
#ifdef SSL_ENABLE
- flag has_ssl = FALSE;
+ static flag has_ssl = FALSE;
#endif /* SSL_ENABLE */
#ifdef NTLM_ENABLE
#else
current.server.authenticate = A_KERBEROS_V4;
#endif /* KERBEROS_V5 */
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
current.server.service = KPOP_PORT;
#else /* INET6_ENABLE */
current.server.port = KPOP_PORT;
| CHECKALIAS {current.server.checkalias = FLAG_TRUE;}
| NO CHECKALIAS {current.server.checkalias = FLAG_FALSE;}
| SERVICE STRING {
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
current.server.service = $2;
#endif /* INET6_ENABLE */
}
| PORT NUMBER {
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
int port = $2;
char buf[10];
sprintf(buf, "%d", port);
int yywrap(void) {return 1;}
/* rcfile_y.y ends here */
-
-
/* If NULL, report will flush stderr, then print on stderr the program
name, a colon and a space. Otherwise, report will call this
function without parameters instead. */
-void (*report_print_progname) (
+static void (*report_print_progname) (
#if __STDC__ - 0
void
#endif
#include <varargs.h>
#endif
#include <ctype.h>
+#include <langinfo.h>
/* for W* macros after pclose() */
#define _USE_BSD
static SSL_CTX *_ctx = NULL;
static SSL *_ssl_context[FD_SETSIZE];
-SSL *SSLGetContext( int );
+static SSL *SSLGetContext( int );
#endif /* SSL_ENABLE */
int SockWrite(int sock, char *buf, int len)
{
char *newline, *bp = buf;
int n;
+#ifdef FORCE_STUFFING
int maxavailable = 0;
+#endif
#ifdef SSL_ENABLE
SSL *ssl;
#endif
(void)SSL_get_error(ssl, n);
return(-1);
}
+#ifdef FORCE_STUFFING
maxavailable = n;
+#endif
if( 0 == n ) {
/* SSL_peek says no data... Does he mean no data
or did the connection blow up? If we got an error
if ((n = fm_peek(sock, bp, len)) <= 0)
#endif
return (-1);
+#ifdef FORCE_STUFFING
maxavailable = n;
+#endif
if ((newline = memchr(bp, '\n', n)) != NULL)
n = newline - bp + 1;
#ifndef __BEOS__
#include "socket.h"
#include "fetchmail.h"
-#ifndef strstr /* glibc-2.1 declares this as a macro */
-extern char *strstr(const char *, const char *); /* needed on sysV68 R3V7.1. */
-#endif /* strstr */
-
int mytimeout; /* value of nonreponse timeout */
int suppress_tags; /* emit tags? */
char shroud[PASSWORDLEN*2+3]; /* string to shroud in debug output */
for (remaining = fetchlen; remaining > 0 || protocol->delimited; )
{
char *line, *rline;
- int overlong = FALSE;
+ int overlong = FALSE; /* XXX FIXME: this is unused */
line = xmalloc(sizeof(buf));
linelen = 0;