* lib-src/movemail.c (main): Assume EAGAIN and EBUSY.
* src/dired.c (directory_files_internal, file_name_completion):
Assume EAGAIN and EINTR are defined.
* src/fileio.c (Fcopy_file): Assume EISDIR is defined.
* src/gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
* src/gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
* src/lread.c (readbyte_from_file): Assume EINTR is defined.
* src/process.c (wait_reading_process_output, send_process) [subprocesses]:
Assume EIO and EAGAIN are defined.
* src/unexcoff.c (write_segment): Assume EFAULT is defined.
Fixes: debbugs:12968
+2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
+ * movemail.c (main): Assume EAGAIN and EBUSY.
+
2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
movemail: treat EACCES etc. failures as permanent
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);
+2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
+ * dired.c (directory_files_internal, file_name_completion):
+ Assume EAGAIN and EINTR are defined.
+ * fileio.c (Fcopy_file): Assume EISDIR is defined.
+ * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
+ * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
+ * lread.c (readbyte_from_file): Assume EINTR is defined.
+ * process.c (wait_reading_process_output, send_process) [subprocesses]:
+ Assume EIO and EAGAIN are defined.
+ * unexcoff.c (write_segment): Assume EFAULT is defined.
+
2012-11-27 Eli Zaretskii <eliz@gnu.org>
* fontset.c (Finternal_char_font): Return nil on non-GUI frames.
errno = 0;
dp = readdir (d);
-
- if (dp == NULL && (0
-#ifdef EAGAIN
- || errno == EAGAIN
-#endif
-#ifdef EINTR
- || errno == EINTR
-#endif
- ))
- { QUIT; continue; }
-
- if (dp == NULL)
- break;
+ if (!dp)
+ {
+ if (errno == EAGAIN || errno == EINTR)
+ {
+ QUIT;
+ continue;
+ }
+ break;
+ }
len = dirent_namelen (dp);
name = finalname = make_unibyte_string (dp->d_name, len);
errno = 0;
dp = readdir (d);
- if (dp == NULL && (0
-# ifdef EAGAIN
- || errno == EAGAIN
-# endif
-# ifdef EINTR
- || errno == EINTR
-# endif
- ))
- { QUIT; continue; }
-
- if (!dp) break;
+ if (!dp)
+ {
+ if (errno == EAGAIN || errno == EINTR)
+ {
+ QUIT;
+ continue;
+ }
+ break;
+ }
len = dirent_namelen (dp);
{
if (!(S_ISREG (st.st_mode)) && !(S_ISLNK (st.st_mode)))
{
-#if defined (EISDIR)
/* Get a better looking error message. */
errno = EISDIR;
-#endif /* EISDIR */
report_file_error ("Non-regular file", Fcons (file, Qnil));
}
}
return result;
}
-#ifndef ENOMEM
-#define ENOMEM 12
-#endif
-
-#ifndef EINVAL
-#define EINVAL 22
-#endif
-
int
posix_memalign (void **memptr, size_t alignment, size_t size)
{
if (proc->gnutls_initstage != GNUTLS_STAGE_READY)
{
-#ifdef EWOULDBLOCK
- errno = EWOULDBLOCK;
-#endif
-#ifdef EAGAIN
errno = EAGAIN;
-#endif
return 0;
}
appropriately so that send_process retries the
correct way instead of erroring out. */
if (rtnval == GNUTLS_E_AGAIN)
- {
-#ifdef EWOULDBLOCK
- errno = EWOULDBLOCK;
-#endif
-#ifdef EAGAIN
- errno = EAGAIN;
-#endif
- }
+ errno = EAGAIN;
break;
}
}
an EAGAIN error. Does anybody know of a situation
where a retry is actually needed? */
#if 0
- nread < 0 && (errno == EAGAIN
-#ifdef EFAULT
- || errno == EFAULT
-#endif
+ nread < 0 && (errno == EAGAIN || errno == EFAULT
#ifdef EBADSLT
|| errno == EBADSLT
#endif
block_input ();
c = getc (instream);
-#ifdef EINTR
/* Interrupted reads have been observed while reading over the network. */
while (c == EOF && ferror (instream) && errno == EINTR)
{
clearerr (instream);
c = getc (instream);
}
-#endif
unblock_input ();
total_nread += nread;
got_some_input = 1;
}
-#ifdef EIO
- else if (nread == -1 && EIO == errno)
+ else if (nread == -1 && (errno == EIO || errno == EAGAIN))
break;
-#endif
-#ifdef EAGAIN
- else if (nread == -1 && EAGAIN == errno)
- break;
-#endif
#ifdef EWOULDBLOCK
else if (nread == -1 && EWOULDBLOCK == errno)
break;
if (rv < 0)
{
- if (0
+ if (errno == EAGAIN
#ifdef EWOULDBLOCK
|| errno == EWOULDBLOCK
-#endif
-#ifdef EAGAIN
- || errno == EAGAIN
#endif
)
/* Buffer is full. Wait, accepting input;
a gap between the old text segment and the old data segment.
This gap has probably been remapped into part of the text segment.
So write zeros for it. */
- if (ret == -1
-#ifdef EFAULT
- && errno == EFAULT
-#endif
- )
+ if (ret == -1 && errno == EFAULT)
{
/* Write only a page of zeros at once,
so that we don't overshoot the start