Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 99751. ------------------------------------------------------------ revno: 99751 committer: YAMAMOTO Mitsuharu branch nick: trunk timestamp: Thu 2010-03-25 17:56:15 +0900 message: Don't call turn_on_atimers around `connect' (Bug#5723). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-03-25 08:48:52 +0000 +++ src/ChangeLog 2010-03-25 08:56:15 +0000 @@ -1,3 +1,8 @@ +2010-03-25 YAMAMOTO Mitsuharu + + * process.c (Fmake_network_process): Don't call turn_on_atimers around + `connect' (Bug#5723). + 2010-03-25 Helmut Eller * process.c (Fmake_network_process): Call `select' for interrupted === modified file 'src/process.c' --- src/process.c 2010-03-25 08:48:52 +0000 +++ src/process.c 2010-03-25 08:56:15 +0000 @@ -3615,23 +3615,9 @@ immediate_quit = 1; QUIT; - /* This turns off all alarm-based interrupts; the - bind_polling_period call above doesn't always turn all the - short-interval ones off, especially if interrupt_input is - set. - - It'd be nice to be able to control the connect timeout - though. Would non-blocking connect calls be portable? - - This used to be conditioned by HAVE_GETADDRINFO. Why? */ - - turn_on_atimers (0); - ret = connect (s, lres->ai_addr, lres->ai_addrlen); xerrno = errno; - turn_on_atimers (1); - if (ret == 0 || xerrno == EISCONN) { /* The unwind-protect will be discarded afterwards. ------------------------------------------------------------ revno: 99750 author: Helmut Eller committer: YAMAMOTO Mitsuharu branch nick: trunk timestamp: Thu 2010-03-25 17:48:52 +0900 message: Call `select' for interrupted `connect' rather than creating new socket (Bug#5173). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-03-24 18:02:56 +0000 +++ src/ChangeLog 2010-03-25 08:48:52 +0000 @@ -1,3 +1,8 @@ +2010-03-25 Helmut Eller + + * process.c (Fmake_network_process): Call `select' for interrupted + `connect' rather than creating new socket (Bug#5173). + 2010-03-24 Jan Djärv * frame.c (x_get_arg): Handle RES_TYPE_BOOLEAN_NUMBER (bug #5736). === modified file 'src/process.c' --- src/process.c 2010-03-22 19:51:59 +0000 +++ src/process.c 2010-03-25 08:48:52 +0000 @@ -3534,8 +3534,6 @@ { int optn, optbits; - retry_connect: - s = socket (lres->ai_family, lres->ai_socktype, lres->ai_protocol); if (s < 0) { @@ -3652,6 +3650,38 @@ #endif #endif #endif + if (xerrno == EINTR) + { + /* Unlike most other syscalls connect() cannot be called + again. (That would return EALREADY.) The proper way to + wait for completion is select(). */ + int sc; + SELECT_TYPE fdset; + retry_select: + FD_ZERO (&fdset); + FD_SET (s, &fdset); + QUIT; + sc = select (s + 1, (SELECT_TYPE *)0, &fdset, (SELECT_TYPE *)0, + (EMACS_TIME *)0); + if (sc == -1) + { + if (errno == EINTR) + goto retry_select; + else + report_file_error ("select failed", Qnil); + } + eassert (sc > 0); + { + int len = sizeof xerrno; + eassert (FD_ISSET (s, &fdset)); + if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) == -1) + report_file_error ("getsockopt failed", Qnil); + if (xerrno != 0) + errno = xerrno, report_file_error ("error during connect", Qnil); + else + break; + } + } immediate_quit = 0; @@ -3659,9 +3689,6 @@ specpdl_ptr = specpdl + count1; emacs_close (s); s = -1; - - if (xerrno == EINTR) - goto retry_connect; } if (s >= 0) ------------------------------------------------------------ revno: 99749 committer: Glenn Morris branch nick: trunk timestamp: Wed 2010-03-24 23:18:17 -0700 message: Close bug#5755. * desktop.el (desktop-save-buffer-p): Don't mistakenly include all dired buffers, even tramp ones. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-03-25 00:06:08 +0000 +++ lisp/ChangeLog 2010-03-25 06:18:17 +0000 @@ -1,3 +1,8 @@ +2010-03-25 Glenn Morris + + * desktop.el (desktop-save-buffer-p): Don't mistakenly include + all dired buffers, even tramp ones. (Bug#5755) + 2010-03-25 Stefan Monnier Add "union tags" in mpc.el. === modified file 'lisp/desktop.el' --- lisp/desktop.el 2010-01-13 08:35:10 +0000 +++ lisp/desktop.el 2010-03-25 06:18:17 +0000 @@ -1,7 +1,8 @@ ;;; desktop.el --- save partial status of Emacs when killed ;; Copyright (C) 1993, 1994, 1995, 1997, 2000, 2001, 2002, 2003, -;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. ;; Author: Morten Welinder ;; Keywords: convenience @@ -811,19 +812,23 @@ FILENAME is the visited file name, BUFNAME is the buffer name, and MODE is the major mode. \n\(fn FILENAME BUFNAME MODE)" - (let ((case-fold-search nil)) + (let ((case-fold-search nil) + dired-skip) (and (not (and (stringp desktop-buffers-not-to-save) (not filename) (string-match desktop-buffers-not-to-save bufname))) (not (memq mode desktop-modes-not-to-save)) + ;; FIXME this is broken if desktop-files-not-to-save is nil. (or (and filename (stringp desktop-files-not-to-save) (not (string-match desktop-files-not-to-save filename))) (and (eq mode 'dired-mode) (with-current-buffer bufname - (not (string-match desktop-files-not-to-save - default-directory)))) + (not (setq dired-skip + (string-match desktop-files-not-to-save + default-directory))))) (and (null filename) + (null dired-skip) ; bug#5755 (with-current-buffer bufname desktop-save-buffer)))))) ;; ----------------------------------------------------------------------------