]> Pileus Git - ~andy/fetchmail/commitdiff
Ready for 3-4.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 13 Feb 1997 01:19:04 +0000 (01:19 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 13 Feb 1997 01:19:04 +0000 (01:19 -0000)
svn path=/trunk/; revision=872

etrn.c
fetchmail.c
fetchmail.h

diff --git a/etrn.c b/etrn.c
index e78458195ea0249c1c7348c06cb82938d7cd5e26..e791f4fc97580a928707187459c7a8c71cd4c1cb 100644 (file)
--- a/etrn.c
+++ b/etrn.c
@@ -45,8 +45,7 @@ static int etrn_getrange(FILE *sockfp, struct query *ctl, int*countp, int*newp)
     *countp = *newp = -1;      /* make sure we don't enter the fetch loop */
 
     /* ship the actual poll and get the response */
-    gethostbyname(buf, sizeof(buf));
-    gen_send(sockfp, "ETRN %s", buf);
+    gen_send(sockfp, "ETRN %s", fetchmailhost);
     if (ok = gen_recv(sockfp, buf, sizeof(buf)))
        return(ok);
 
index 1caf1d982ff235e5943aa724374e1337acf04211..20c9cc4596aa32429e7ef7d3aa37527ea01cf3e0 100644 (file)
@@ -65,6 +65,7 @@ char *rcfile;         /* path name of rc file */
 char *idfile;          /* UID list file */
 int versioninfo;       /* emit only version info */
 char *user;            /* the name of the invoking user */
+char *fetchmailhost;   /* the name of the host running fetchmail */
 char *program_name;    /* the name to prefix error messages with */
 
 static char *lockfile;         /* name of lockfile */
@@ -115,6 +116,10 @@ int main (int argc, char **argv)
        }
     }
 
+    /* we'll need this for error messages */
+    gethostname(tmpbuf, sizeof(tmpbuf));
+    fetchmailhost = xstrdup(tmpbuf);
+
     /*
      * Backward-compatibility hack.  If we're called by the name of the
      * ancestral popclient, look for .poprc.  This will actually work 
index baba9198fe4e1b49fd634ea0fac7b528e5aa1a7d..7ee72a2f91e19c4d8af5e95185d845ff4939c327 100644 (file)
@@ -178,6 +178,7 @@ extern char *idfile;                /* path name of UID file */
 extern int linelimit;          /* limit # lines retrieved per site */
 extern int versioninfo;                /* emit only version info */
 extern char *user;             /* name of invoking user */
+extern char *fetchmailhost;    /* the name of the host running fetchmail */
 
 /* prototypes for globally callable functions */
 #if defined(HAVE_STDARG_H)