aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2010-04-29 20:41:32 +0200
committerMatthias Andree <matthias.andree@gmx.de>2010-04-29 20:41:39 +0200
commit064e3c024f388b36af5d39702cbf64e24613cb4f (patch)
treed0d84a9fdf3e240c976ac220730f34df3e0617c0
parentbe9e00b0ca370a7620b57f4714db808742d8302e (diff)
downloadfetchmail-064e3c024f388b36af5d39702cbf64e24613cb4f.tar.gz
fetchmail-064e3c024f388b36af5d39702cbf64e24613cb4f.tar.bz2
fetchmail-064e3c024f388b36af5d39702cbf64e24613cb4f.zip
Properly use long to map pid_t.
-rw-r--r--fetchmail.c24
-rw-r--r--lock.c5
2 files changed, 15 insertions, 14 deletions
diff --git a/fetchmail.c b/fetchmail.c
index 93ce7128..e3eebfdd 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -446,8 +446,8 @@ int main(int argc, char **argv)
}
else if (kill(pid, SIGTERM) < 0)
{
- fprintf(stderr,GT_("fetchmail: error killing %s fetchmail at %d; bailing out.\n"),
- bkgd ? GT_("background") : GT_("foreground"), pid);
+ fprintf(stderr,GT_("fetchmail: error killing %s fetchmail at %ld; bailing out.\n"),
+ bkgd ? GT_("background") : GT_("foreground"), (long)pid);
exit(PS_EXCLUDE);
}
else
@@ -455,8 +455,8 @@ int main(int argc, char **argv)
int maxwait;
if (outlevel > O_SILENT)
- fprintf(stderr,GT_("fetchmail: %s fetchmail at %d killed.\n"),
- bkgd ? GT_("background") : GT_("foreground"), pid);
+ fprintf(stderr,GT_("fetchmail: %s fetchmail at %ld killed.\n"),
+ bkgd ? GT_("background") : GT_("foreground"), (long)pid);
/* We used to nuke the other process's lock here, with
* fm_lock_release(), which is broken. The other process
* needs to clear its lock by itself. */
@@ -484,15 +484,15 @@ int main(int argc, char **argv)
else if (!implicitmode)
{
fprintf(stderr,
- GT_("fetchmail: can't poll specified hosts with another fetchmail running at %d.\n"),
- pid);
+ GT_("fetchmail: can't poll specified hosts with another fetchmail running at %ld.\n"),
+ (long)pid);
return(PS_EXCLUDE);
}
else if (!bkgd)
{
fprintf(stderr,
- GT_("fetchmail: another foreground fetchmail is running at %d.\n"),
- pid);
+ GT_("fetchmail: another foreground fetchmail is running at %ld.\n"),
+ (long)pid);
return(PS_EXCLUDE);
}
else if (getpid() == pid)
@@ -507,8 +507,8 @@ int main(int argc, char **argv)
else if (kill(pid, SIGUSR1) == 0)
{
fprintf(stderr,
- GT_("fetchmail: background fetchmail at %d awakened.\n"),
- pid);
+ GT_("fetchmail: background fetchmail at %ld awakened.\n"),
+ (long)pid);
return(0);
}
else
@@ -519,8 +519,8 @@ int main(int argc, char **argv)
* SIGUSR1/SIGHUP transmission.
*/
fprintf(stderr,
- GT_("fetchmail: elder sibling at %d died mysteriously.\n"),
- pid);
+ GT_("fetchmail: elder sibling at %ld died mysteriously.\n"),
+ (long)pid);
return(PS_UNDEFINED);
}
}
diff --git a/lock.c b/lock.c
index 111559e7..213969f1 100644
--- a/lock.c
+++ b/lock.c
@@ -73,13 +73,14 @@ void fm_lock_dispose(void)
int fm_lock_state(void)
{
- int pid, st;
+ long pid;
+ int st;
FILE *lockfp;
int bkgd = FALSE;
if ((lockfp = fopen(lockfile, "r")) != NULL)
{
- int args = fscanf(lockfp, "%d %d", &pid, &st);
+ int args = fscanf(lockfp, "%ld %d", &pid, &st);
bkgd = (args == 2);
if (ferror(lockfp)) {