diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-16 14:20:25 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-16 14:20:25 -0700 |
commit | 5a9c1e26a73394d076607fa027b8d7848231c2f8 (patch) | |
tree | 131e7fc2ac8954a7e6159611807595f22935752c /lib-src/movemail.c | |
parent | cd52b2441e95f407c0332534ae1997023fe62461 (diff) | |
download | emacs-5a9c1e26a73394d076607fa027b8d7848231c2f8.tar.gz emacs-5a9c1e26a73394d076607fa027b8d7848231c2f8.tar.bz2 emacs-5a9c1e26a73394d076607fa027b8d7848231c2f8.zip |
* movemail.c (mail_spool_name): Protoize.
(main): Remove unused var. Mark var as initialized.
Move locals to avoid shadowing, and use time_t for times.
Diffstat (limited to 'lib-src/movemail.c')
-rw-r--r-- | lib-src/movemail.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 4a894c1cba1..4cf97cbac18 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -131,7 +131,7 @@ extern int lk_open (), lk_close (); files appear in. */ #ifdef MAILDIR #define MAIL_USE_MAILLOCK -static char *mail_spool_name (); +static char *mail_spool_name (char *); #endif #endif @@ -167,7 +167,6 @@ main (int argc, char **argv) #ifndef MAIL_USE_SYSTEM_LOCK struct stat st; - long now; int tem; char *lockname, *p; char *tempname; @@ -259,7 +258,13 @@ main (int argc, char **argv) #ifndef MAIL_USE_SYSTEM_LOCK #ifdef MAIL_USE_MAILLOCK spool_name = mail_spool_name (inname); - if (! spool_name) + if (spool_name) + { +#ifdef lint + lockname = 0; +#endif + } + else #endif { #ifndef DIRECTORY_SEP @@ -336,7 +341,7 @@ main (int argc, char **argv) by time differences between machines. */ if (stat (lockname, &st) >= 0) { - now = time (0); + time_t now = time (0); if (st.st_ctime < now - 300) unlink (lockname); } @@ -352,7 +357,10 @@ main (int argc, char **argv) int lockcount = 0; int status = 0; #if defined (MAIL_USE_MAILLOCK) && defined (HAVE_TOUCHLOCK) - time_t touched_lock, now; + time_t touched_lock; +# ifdef lint + touched_lock = 0; +# endif #endif if (setuid (getuid ()) < 0 || setregid (-1, real_gid) < 0) @@ -462,7 +470,7 @@ main (int argc, char **argv) #if defined (MAIL_USE_MAILLOCK) && defined (HAVE_TOUCHLOCK) if (spool_name) { - now = time (0); + time_t now = time (0); if (now - touched_lock > 60) { touchlock (); |