]> Pileus Git - ~andy/fetchmail/blobdiff - fetchmail.c
Deal with Post Office/NT.
[~andy/fetchmail] / fetchmail.c
index 4730e1e75ee432793ce0c7cd7cf514e1d19853a6..54dc45c66640782b019071ace28b48cf27b5e5d6 100644 (file)
 #include <netdb.h>
 #endif /* HAVE_GETHOSTBYNAME */
 
-#ifdef SUNOS
-#include <stdlib.h>
-#endif
-
 #include "fetchmail.h"
 #include "tunable.h"
 #include "smtp.h"
@@ -68,6 +64,7 @@ int cmd_daemon;       /* if --daemon was set */
 char *idfile;          /* UID list file */
 flag versioninfo;      /* emit only version info */
 char *user;            /* the name of the invoking user */
+char *home;
 char *fetchmailhost;   /* the name of the host running fetchmail */
 char *program_name;    /* the name to prefix error messages with */
 
@@ -94,7 +91,6 @@ int main (int argc, char **argv)
 {
     int st, bkgd = FALSE;
     int parsestatus, implicitmode = FALSE;
-    struct passwd *pw;
     struct query *ctl;
     FILE       *lockfp;
     netrc_entry *netrc_list;
@@ -131,7 +127,7 @@ int main (int argc, char **argv)
 
     /* set up to do lock protocol */
     if (!getuid())
-       strcpy(tmpbuf, "/var/run/fetchmail.pid");
+       sprintf(tmpbuf, "%s/fetchmail.pid", PID_DIR);
     else {
        strcpy(tmpbuf, home);
        strcat(tmpbuf, "/.fetchmail");
@@ -521,7 +517,7 @@ static int load_params(int argc, char **argv, int optind)
 {
     int        implicitmode, st;
     struct passwd *pw;
-    struct query def_opts, *ctl, *mp;
+    struct query def_opts, *ctl;
 
     memset(&def_opts, '\0', sizeof(struct query));
     def_opts.smtp_socket = -1;
@@ -529,8 +525,8 @@ static int load_params(int argc, char **argv, int optind)
     def_opts.server.protocol = P_AUTO;
     def_opts.server.timeout = CLIENT_TIMEOUT;
     def_opts.remotename = user;
-    save_str(&def_opts.smtphunt, -1, fetchmailhost);
-    save_str(&def_opts.smtphunt, -1, "localhost");
+    save_str(&def_opts.smtphunt, TRUE, fetchmailhost);
+    save_str(&def_opts.smtphunt, FALSE, "localhost");
 
     /* this builds the host list */
     if (prc_parse_file(rcfile, !versioninfo) != 0)