[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/dired.c
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/src/dired.c |
Date: |
Fri, 02 Sep 2005 14:42:56 -0400 |
Index: emacs/src/dired.c
diff -c emacs/src/dired.c:1.117 emacs/src/dired.c:1.118
*** emacs/src/dired.c:1.117 Sun Aug 7 12:33:16 2005
--- emacs/src/dired.c Fri Sep 2 18:42:54 2005
***************
*** 131,137 ****
directory_files_internal_unwind (dh)
Lisp_Object dh;
{
! DIR *d = (DIR *) ((XINT (XCAR (dh)) << 16) + XINT (XCDR (dh)));
closedir (d);
return Qnil;
}
--- 131,137 ----
directory_files_internal_unwind (dh)
Lisp_Object dh;
{
! DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer;
closedir (d);
return Qnil;
}
***************
*** 155,161 ****
int count = SPECPDL_INDEX ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
DIRENTRY *dp;
- int retry_p;
/* Because of file name handlers, these functions might call
Ffuncall, and cause a GC. */
--- 155,160 ----
***************
*** 189,200 ****
/* Now *bufp is the compiled form of MATCH; don't call anything
which might compile a new regexp until we're done with the loop! */
- /* Do this opendir after anything which might signal an error; if
- an error is signaled while the directory stream is open, we
- have to make sure it gets closed, and setting up an
- unwind_protect to do so would be a pain. */
- retry:
-
d = opendir (SDATA (dirfilename));
if (d == NULL)
report_file_error ("Opening directory", Fcons (directory, Qnil));
--- 188,193 ----
***************
*** 203,210 ****
file-attributes on filenames, both of which can throw, so we must
do a proper unwind-protect. */
record_unwind_protect (directory_files_internal_unwind,
! Fcons (make_number (((unsigned long) d) >> 16),
! make_number (((unsigned long) d) & 0xffff)));
directory_nbytes = SBYTES (directory);
re_match_object = Qt;
--- 196,202 ----
file-attributes on filenames, both of which can throw, so we must
do a proper unwind-protect. */
record_unwind_protect (directory_files_internal_unwind,
! make_save_value (d, 0));
directory_nbytes = SBYTES (directory);
re_match_object = Qt;
***************
*** 222,231 ****
errno = 0;
dp = readdir (d);
#ifdef EAGAIN
! if (dp == NULL && errno == EAGAIN)
! continue;
#endif
if (dp == NULL)
break;
--- 214,228 ----
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;
***************
*** 316,337 ****
}
}
- retry_p = 0;
- #ifdef EINTR
- retry_p |= errno == EINTR;
- #endif
-
closedir (d);
/* Discard the unwind protect. */
specpdl_ptr = specpdl + count;
- if (retry_p)
- {
- list = Qnil;
- goto retry;
- }
-
if (NILP (nosort))
list = Fsort (Fnreverse (list),
attrs ? Qfile_attributes_lessp : Qstring_lessp);
--- 313,323 ----
***************
*** 519,526 ****
report_file_error ("Opening directory", Fcons (dirname, Qnil));
record_unwind_protect (directory_files_internal_unwind,
! Fcons (make_number (((unsigned long) d) >> 16),
! make_number (((unsigned long) d) &
0xffff)));
/* Loop reading blocks */
/* (att3b compiler bug requires do a null comparison this way) */
--- 505,511 ----
report_file_error ("Opening directory", Fcons (dirname, Qnil));
record_unwind_protect (directory_files_internal_unwind,
! make_save_value (d, 0));
/* Loop reading blocks */
/* (att3b compiler bug requires do a null comparison this way) */
***************
*** 532,539 ****
--- 517,535 ----
#ifdef VMS
dp = (*readfunc) (d);
#else
+ errno = 0;
dp = readdir (d);
+ if (dp == NULL && (0
+ # ifdef EAGAIN
+ || errno == EAGAIN
+ # endif
+ # ifdef EINTR
+ || errno == EINTR
+ # endif
+ ))
+ { QUIT; continue; }
#endif
+
if (!dp) break;
len = NAMLEN (dp);
- [Emacs-diffs] Changes to emacs/src/dired.c,
Stefan Monnier <=