X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/d8fb8cce84b923a3289b69549e30958710ac3ebb..0877d0dc24ee792b9b14592869ea1aa0934aee58:/lib-src/movemail.c diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 0a8806621d..616cbde539 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -65,9 +65,7 @@ along with GNU Emacs. If not, see . */ #include #include -#ifdef HAVE_FCNTL_H #include -#endif #include #include "syswait.h" #ifdef MAIL_USE_POP @@ -98,13 +96,6 @@ along with GNU Emacs. If not, see . */ #include #endif /* WINDOWSNT */ -#ifndef F_OK -#define F_OK 0 -#define X_OK 1 -#define W_OK 2 -#define R_OK 4 -#endif - #ifdef WINDOWSNT #include #endif @@ -337,11 +328,8 @@ main (int argc, char **argv) tem = link (tempname, lockname); -#ifdef EPERM - if (tem < 0 && errno == EPERM) - fatal ("Unable to create hard link between %s and %s", - tempname, lockname); -#endif + if (tem < 0 && errno != EEXIST) + pfatal_with_name (lockname); unlink (tempname); if (tem >= 0) @@ -442,22 +430,10 @@ main (int argc, char **argv) for certain failure codes. */ if (status < 0) { - if (++lockcount <= 5) + if (++lockcount <= 5 && (errno == EAGAIN || errno == EBUSY)) { -#ifdef EAGAIN - if (errno == EAGAIN) - { - sleep (1); - goto retry_lock; - } -#endif -#ifdef EBUSY - if (errno == EBUSY) - { - sleep (1); - goto retry_lock; - } -#endif + sleep (1); + goto retry_lock; } pfatal_with_name (inname);