[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AW: AW: AW: Can't interrupt directory_files_internalrunfromtimer-eve
From: |
Stefan Monnier |
Subject: |
Re: AW: AW: AW: Can't interrupt directory_files_internalrunfromtimer-event-handler |
Date: |
Sun, 14 Aug 2005 02:47:09 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) |
> I looked at the code for directory-files, and it seems you cannot quit
> out of it while it is waiting in a system call.
Why is that?
> It is probably possible to implement quitting out of the system call
> in directory-files. Doing this requires setting immediate_quit to 1,
> at least while that system call is running.
Looking at this code made me notice that the filename completion doesn't
handle the EAGAIN case like directory-files does. And also that
directory-files doesn't check QUIT if it had been interrupted, which can
fail to react to C-g in cases such as SYNC_INPUT.
So I've installed the patch below.
> Which system call takes the long time? Is it opendir, or readdir?
If the NFS server is down, I suspect that either call can stall.
Stefan
--- dired.c 11 aoû 2005 05:27:35 -0400 1.117
+++ dired.c 14 aoû 2005 02:44:01 -0400
@@ -224,7 +224,7 @@
#ifdef EAGAIN
if (dp == NULL && errno == EAGAIN)
- continue;
+ { QUIT; continue; }
#endif
if (dp == NULL)
@@ -533,6 +533,10 @@
dp = (*readfunc) (d);
#else
dp = readdir (d);
+#endif
+#ifdef EAGAIN
+ if (dp == NULL && errno == EAGAIN)
+ { QUIT; continue; }
#endif
if (!dp) break;