From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: AW: AW: AW: Can't interrupt directory_files_internalrunfromtimer-event-handler Date: Sun, 14 Aug 2005 02:47:09 -0400 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1124002760 28048 80.91.229.2 (14 Aug 2005 06:59:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 14 Aug 2005 06:59:20 +0000 (UTC) Cc: kzeitler@lucent.com, emacs-devel@gnu.org, klaus.berndl@sdm.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 14 08:59:10 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E4CSD-0008Qi-CR for ged-emacs-devel@m.gmane.org; Sun, 14 Aug 2005 08:58:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E4CVV-0003EM-TV for ged-emacs-devel@m.gmane.org; Sun, 14 Aug 2005 03:02:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E4CUo-0003CS-LL for emacs-devel@gnu.org; Sun, 14 Aug 2005 03:01:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E4CUb-00033V-Fs for emacs-devel@gnu.org; Sun, 14 Aug 2005 03:01:13 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E4CUY-0002yR-Ee for emacs-devel@gnu.org; Sun, 14 Aug 2005 03:01:10 -0400 Original-Received: from [195.186.19.66] (helo=mail22.bluewin.ch) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E4CW9-0005Mr-Kf; Sun, 14 Aug 2005 03:02:49 -0400 Original-Received: from empanada.local (213.3.54.100) by mail22.bluewin.ch (Bluewin 7.2.063) id 42E684E00029BA5B; Sun, 14 Aug 2005 06:47:19 +0000 Original-Received: by empanada.local (Postfix, from userid 502) id 1716D62BCF4; Sun, 14 Aug 2005 02:47:09 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: (Richard M. Stallman's message of "Fri, 12 Aug 2005 15:58:35 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:42020 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:42020 > 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=FB 2005 05:27:35 -0400 1.117 +++ dired.c 14 ao=FB 2005 02:44:01 -0400=09 @@ -224,7 +224,7 @@ =20 #ifdef EAGAIN if (dp =3D=3D NULL && errno =3D=3D EAGAIN) - continue; + { QUIT; continue; } #endif =20 if (dp =3D=3D NULL) @@ -533,6 +533,10 @@ dp =3D (*readfunc) (d); #else dp =3D readdir (d); +#endif +#ifdef EAGAIN + if (dp =3D=3D NULL && errno =3D=3D EAGAIN) + { QUIT; continue; } #endif if (!dp) break; =20