]> code.delx.au - gnu-emacs/blobdiff - lib-src/movemail.c
; Merge from origin/emacs-25
[gnu-emacs] / lib-src / movemail.c
index 231bc22fa89609ebe766f0d49b42be13273f3003..eb1962a8f6b9a03810ea8115a16aceb818b99032 100644 (file)
@@ -1,7 +1,7 @@
 /* movemail foo bar -- move file foo to file bar,
    locking file foo the way /bin/mail respects.
 
-Copyright (C) 1986, 1992-1994, 1996, 1999, 2001-2015 Free Software
+Copyright (C) 1986, 1992-1994, 1996, 1999, 2001-2016 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -174,8 +174,6 @@ main (int argc, char **argv)
   int desc;
 #endif /* not MAIL_USE_SYSTEM_LOCK */
 
-  char *spool_name = 0;
-
 #ifdef MAIL_USE_POP
   bool pop_reverse_order = false;
 # define ARGSTR "pr"
@@ -246,13 +244,14 @@ main (int argc, char **argv)
 #ifndef DISABLE_DIRECT_ACCESS
 
   char *lockname = 0;
+  char *spool_name = 0;
 
-#ifndef MAIL_USE_SYSTEM_LOCK
 #ifdef MAIL_USE_MAILLOCK
   spool_name = mail_spool_name (inname);
 #endif
   if (! spool_name)
     {
+#ifndef MAIL_USE_SYSTEM_LOCK
       /* Use a lock file named after our first argument with .lock appended:
         If it exists, the mail file is locked.  */
       /* Note: this locking mechanism is *required* by the mailer
@@ -323,8 +322,8 @@ main (int argc, char **argv)
        }
 
       delete_lockname = lockname;
-    }
 #endif /* not MAIL_USE_SYSTEM_LOCK */
+    }
 
 #ifdef SIGCHLD
   signal (SIGCHLD, SIG_DFL);