Now on revision 110802. ------------------------------------------------------------ revno: 110802 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-11-05 12:00:58 +0800 message: * process.c (wait_reading_process_output): Revert previous change. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-05 03:18:32 +0000 +++ src/ChangeLog 2012-11-05 04:00:58 +0000 @@ -1,3 +1,7 @@ +2012-11-05 Chong Yidong + + * process.c (wait_reading_process_output): Revert previous change. + 2012-11-05 Paul Eggert Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800). === modified file 'src/process.c' --- src/process.c 2012-11-05 03:18:32 +0000 +++ src/process.c 2012-11-05 04:00:58 +0000 @@ -4336,6 +4336,8 @@ while (1) { + int timeout_reduced_for_timers = 0; + /* If calling from keyboard input, do not quit since we want to return C-g as an input character. Otherwise, do pending quit if requested. */ @@ -4415,7 +4417,10 @@ if (EMACS_TIME_VALID_P (timer_delay)) { if (EMACS_TIME_LT (timer_delay, timeout)) - timeout = timer_delay; + { + timeout = timer_delay; + timeout_reduced_for_timers = 1; + } } else { @@ -4674,12 +4679,9 @@ /* If we woke up due to SIGWINCH, actually change size now. */ do_pending_window_change (0); - /* We used to break here if nfds == 0, i.e. we seemed to have - waited the full period. But apparently if Emacs receives - SIGIO between set_waiting_for_input and select, select can - return with nfds == 0 due to the timeout being zeroed out by - the signal handler (Bug#11536). */ - + if ((time_limit || nsecs) && nfds == 0 && ! timeout_reduced_for_timers) + /* We waited the full specified time, so return now. */ + break; if (nfds < 0) { if (xerrno == EINTR) ------------------------------------------------------------ revno: 110801 fixes bug: http://debbugs.gnu.org/12800 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-11-04 19:18:32 -0800 message: Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid. This removes code that has been obsolete since around 1990. * admin/CPP-DEFINES (HAVE_SETPGID, HAVE_SETSID, SETPGRP_RELEASES_CTTY): Remove; obsolete. * configure.ac (setpgid, setsid): Assume their existence. (AC_FUNC_GETPGRP, SETPGRP_RELEASES_CTTY): Remove; obsolete. * src/callproc.c (Fcall_process): * src/emacs.c (main): * src/process.c (create_process): * src/term.c (dissociate_if_controlling_tty): Assume setsid exists. * src/callproc.c (child_setup): Assume setpgid exists and behaves as per POSIX.1-1988 or later. * src/conf_post.h (setpgid) [!HAVE_SETPGID]: Remove. * src/emacs.c (shut_down_emacs): * src/sysdep.c (sys_suspend, init_foreground_group): Assume getpgrp behaves as per POSIX.1-1998 or later. * src/msdos.c (setpgrp): Remove. (tcgetpgrp, setpgid, setsid): New functions. * src/systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp. * src/term.c (no_controlling_tty): Remove; unused. * src/w32proc.c (setpgrp): Remove. (setsid, tcgetpgrp): New functions. diff: === modified file 'ChangeLog' --- ChangeLog 2012-11-05 01:59:00 +0000 +++ ChangeLog 2012-11-05 03:18:32 +0000 @@ -1,5 +1,9 @@ 2012-11-05 Paul Eggert + Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800). + * configure.ac (setpgid, setsid): Assume their existence. + (AC_FUNC_GETPGRP, SETPGRP_RELEASES_CTTY): Remove; obsolete. + Simplify by assuming __fpending. Now that Emacs is using the gnulib fpending module, there's no need for Emacs to have a separate implementation. === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2012-11-05 01:59:00 +0000 +++ admin/CPP-DEFINES 2012-11-05 03:18:32 +0000 @@ -298,9 +298,7 @@ HAVE_SEQPACKET HAVE_SETITIMER HAVE_SETLOCALE -HAVE_SETPGID HAVE_SETRLIMIT -HAVE_SETSID HAVE_SHARED_GAME_DIR HAVE_SHUTDOWN HAVE_SIGNED_${GLTYPE} @@ -432,7 +430,6 @@ PTY_TTY_NAME_SPRINTF PURESIZE RUN_TIME_REMAP -SETPGRP_RELEASES_CTTY SETUP_SLAVE_PTY SIGALRM SIGCHLD === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-11-05 01:59:00 +0000 +++ admin/ChangeLog 2012-11-05 03:18:32 +0000 @@ -1,5 +1,9 @@ 2012-11-05 Paul Eggert + Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800). + * CPP-DEFINES (HAVE_SETPGID, HAVE_SETSID, SETPGRP_RELEASES_CTTY): + Remove; obsolete. + Simplify by assuming __fpending. * CPP-DEFINES (PENDING_OUTPUT_COUNT): Remove. === modified file 'configure.ac' --- configure.ac 2012-11-05 01:59:00 +0000 +++ configure.ac 2012-11-05 03:18:32 +0000 @@ -2871,9 +2871,9 @@ AC_CHECK_FUNCS(gethostname \ closedir getrusage get_current_dir_name \ -lrand48 setsid \ +lrand48 \ fpathconf select euidaccess getpagesize setlocale \ -utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \ +utimes getrlimit setrlimit getcwd shutdown getaddrinfo \ strsignal setitimer \ sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \ gai_strerror mkstemp getline getdelim fsync sync \ @@ -2916,8 +2916,6 @@ AC_FUNC_FSEEKO -AC_FUNC_GETPGRP - # UNIX98 PTYs. AC_CHECK_FUNCS(grantpt) @@ -3964,8 +3962,6 @@ irix6-5) AC_DEFINE(PREFER_VSUSP, 1, [Define if process_send_signal should use VSUSP instead of VSWTCH.]) - AC_DEFINE(SETPGRP_RELEASES_CTTY, 1, [Define if process.c:child_setup - should not call setpgrp.]) ;; sol2-10) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-05 01:59:00 +0000 +++ src/ChangeLog 2012-11-05 03:18:32 +0000 @@ -1,5 +1,25 @@ 2012-11-05 Paul Eggert + Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800). + This removes code that has been obsolete since around 1990. + * callproc.c (Fcall_process): + * emacs.c (main): + * process.c (create_process): + * term.c (dissociate_if_controlling_tty): + Assume setsid exists. + * callproc.c (child_setup): Assume setpgid exists and behaves as + per POSIX.1-1988 or later. + * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove. + * emacs.c (shut_down_emacs): + * sysdep.c (sys_suspend, init_foreground_group): + Assume getpgrp behaves as per POSIX.1-1998 or later. + * msdos.c (setpgrp): Remove. + (tcgetpgrp, setpgid, setsid): New functions. + * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp. + * term.c (no_controlling_tty): Remove; unused. + * w32proc.c (setpgrp): Remove. + (setsid, tcgetpgrp): New functions. + Simplify by assuming __fpending. * dispnew.c: Include , not . (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT. === modified file 'src/callproc.c' --- src/callproc.c 2012-10-31 17:27:29 +0000 +++ src/callproc.c 2012-11-05 03:18:32 +0000 @@ -612,11 +612,7 @@ if (fd[0] >= 0) emacs_close (fd[0]); -#ifdef HAVE_SETSID setsid (); -#else - setpgid (0, 0); -#endif /* Emacs ignores SIGPIPE, but the child should not. */ signal (SIGPIPE, SIG_DFL); @@ -1286,11 +1282,7 @@ if (err != in && err != out) emacs_close (err); -#if defined HAVE_SETPGID || ! (defined USG && defined SETPGRP_RELEASES_CTTY) - setpgid (pid, pid); -#endif - - /* setpgrp_of_tty is incorrect here; it uses input_fd. */ + setpgid (0, 0); tcsetpgrp (0, pid); /* execvp does not accept an environment arg so the only way === modified file 'src/conf_post.h' --- src/conf_post.h 2012-11-03 13:48:33 +0000 +++ src/conf_post.h 2012-11-05 03:18:32 +0000 @@ -121,14 +121,6 @@ #define emacs_raise(sig) msdos_fatal_signal (sig) -#ifndef HAVE_SETPGID -# ifdef USG -# define setpgid(pid, pgid) setpgrp () -# else -# define setpgid(pid, pgid) setpgrp (pid, pgid) -# endif -#endif - /* Define one of these for easier conditionals. */ #ifdef HAVE_X_WINDOWS /* We need a little extra space, see ../../lisp/loadup.el and the === modified file 'src/emacs.c' --- src/emacs.c 2012-11-04 17:29:52 +0000 +++ src/emacs.c 2012-11-05 03:18:32 +0000 @@ -1101,9 +1101,7 @@ that it is not accessible to programs started from .emacs. */ fcntl (daemon_pipe[1], F_SETFD, FD_CLOEXEC); -#ifdef HAVE_SETSID setsid (); -#endif #else /* DOS_NT */ fprintf (stderr, "This platform does not support the -daemon flag.\n"); exit (1); @@ -1915,7 +1913,7 @@ /* If we are controlling the terminal, reset terminal modes. */ #ifndef DOS_NT { - pid_t pgrp = EMACS_GETPGRP (0); + pid_t pgrp = getpgrp (); pid_t tpgrp = tcgetpgrp (0); if ((tpgrp != -1) && tpgrp == pgrp) { === modified file 'src/msdos.c' --- src/msdos.c 2012-11-03 13:48:33 +0000 +++ src/msdos.c 2012-11-05 03:18:32 +0000 @@ -3927,8 +3927,10 @@ /* * A few unimplemented functions that we silently ignore. */ -int setpgrp (void) {return 0; } +pid_t tcgetpgrp (int fd) { return 0; } +int setpgid (int pid, int pgid) { return 0; } int setpriority (int x, int y, int z) { return 0; } +pid_t setsid (void) { return 0; } #if __DJGPP__ == 2 && __DJGPP_MINOR__ < 4 ssize_t === modified file 'src/process.c' --- src/process.c 2012-11-03 18:32:41 +0000 +++ src/process.c 2012-11-05 03:18:32 +0000 @@ -1739,7 +1739,6 @@ /* Make the pty be the controlling terminal of the process. */ #ifdef HAVE_PTYS /* First, disconnect its current controlling terminal. */ -#ifdef HAVE_SETSID /* We tried doing setsid only if pty_flag, but it caused process_set_signal to fail on SGI when using a pipe. */ setsid (); @@ -1752,12 +1751,6 @@ ioctl (xforkin, TIOCSCTTY, 0); #endif } -#else /* not HAVE_SETSID */ - /* It's very important to call setpgid here and no time - afterwards. Otherwise, we lose our controlling tty which - is set when we open the pty. */ - setpgid (0, 0); -#endif /* not HAVE_SETSID */ #if defined (LDISC1) if (pty_flag && xforkin >= 0) { @@ -1790,22 +1783,15 @@ ioctl (j, TIOCNOTTY, 0); emacs_close (j); } -#ifndef USG - /* In order to get a controlling terminal on some versions - of BSD, it is necessary to put the process in pgrp 0 - before it opens the terminal. */ - setpgid (0, 0); -#endif } #endif /* TIOCNOTTY */ #if !defined (DONT_REOPEN_PTY) /*** There is a suggestion that this ought to be a - conditional on TIOCSPGRP, - or !(defined (HAVE_SETSID) && defined (TIOCSCTTY)). + conditional on TIOCSPGRP, or !defined TIOCSCTTY. Trying the latter gave the wrong results on Debian GNU/Linux 1.1; that system does seem to need this code, even though - both HAVE_SETSID and TIOCSCTTY are defined. */ + both TIOCSCTTY is defined. */ /* Now close the pty (if we had it open) and reopen it. This makes the pty the controlling terminal of the subprocess. */ if (pty_flag) === modified file 'src/sysdep.c' --- src/sysdep.c 2012-10-31 17:27:29 +0000 +++ src/sysdep.c 2012-11-05 03:18:32 +0000 @@ -452,7 +452,7 @@ #if defined (SIGTSTP) && !defined (MSDOS) { - pid_t pgrp = EMACS_GETPGRP (0); + pid_t pgrp = getpgrp (); EMACS_KILLPG (pgrp, SIGTSTP); } @@ -709,7 +709,7 @@ void init_foreground_group (void) { - pid_t pgrp = EMACS_GETPGRP (0); + pid_t pgrp = getpgrp (); inherited_pgroup = getpid () == pgrp ? 0 : pgrp; } === modified file 'src/systty.h' --- src/systty.h 2012-11-04 22:33:00 +0000 +++ src/systty.h 2012-11-05 03:18:32 +0000 @@ -52,16 +52,6 @@ #endif /* not CDEL */ #endif /* not _POSIX_VDISABLE */ -/* Manipulate a terminal's current process group. */ - -/* EMACS_GETPGRP (arg) returns the process group of the process. */ - -#if defined (GETPGRP_VOID) -# define EMACS_GETPGRP(x) getpgrp() -#else /* !GETPGRP_VOID */ -# define EMACS_GETPGRP(x) getpgrp(x) -#endif /* !GETPGRP_VOID */ - /* Manipulate a TTY's input/output processing parameters. */ /* struct emacs_tty is a structure used to hold the current tty === modified file 'src/term.c' --- src/term.c 2012-11-03 05:59:17 +0000 +++ src/term.c 2012-11-05 03:18:32 +0000 @@ -133,10 +133,6 @@ static int max_frame_cols; -/* Non-zero if we have dropped our controlling tty and therefore - should not open a frame on stdout. */ -static int no_controlling_tty; - #ifdef HAVE_GPM @@ -2918,36 +2914,9 @@ static void dissociate_if_controlling_tty (int fd) { -#ifndef DOS_NT pid_t pgid = tcgetpgrp (fd); /* If tcgetpgrp succeeds, fd is the ctty. */ - if (pgid != -1) - { -#if defined (USG5) - setpgrp (); - no_controlling_tty = 1; -#elif defined (CYGWIN) - setsid (); - no_controlling_tty = 1; -#else -#ifdef TIOCNOTTY /* Try BSD ioctls. */ - sigset_t blocked; - sigemptyset (&blocked); - sigaddset (&blocked, SIGTTOU); - pthread_sigmask (SIG_BLOCK, &blocked, 0); - fd = emacs_open (DEV_TTY, O_RDWR, 0); - if (fd != -1 && ioctl (fd, TIOCNOTTY, 0) != -1) - { - no_controlling_tty = 1; - } - if (fd != -1) - emacs_close (fd); - pthread_sigmask (SIG_UNBLOCK, &blocked, 0); -#else -# error "Unknown system." -#endif /* ! TIOCNOTTY */ -#endif /* ! USG */ - } -#endif /* !DOS_NT */ + if (0 <= pgid) + setsid (); } /* Create a termcap display on the tty device with the given name and === modified file 'src/w32proc.c' --- src/w32proc.c 2012-11-01 14:21:45 +0000 +++ src/w32proc.c 2012-11-05 03:18:32 +0000 @@ -230,24 +230,30 @@ return (*set & (1U << signo)) != 0; } -int -setpgrp (int pid, int gid) -{ - return 0; -} - pid_t getpgrp (void) { return getpid (); } +pid_t +tcgetpgrp (int fd) +{ + return getpid (); +} + int setpgid (pid_t pid, pid_t pgid) { return 0; } +pid_t +setsid (void) +{ + return getpid (); +} + /* Emulations of interval timers. Limitations: only ITIMER_REAL and ITIMER_PROF are supported. ------------------------------------------------------------ revno: 110800 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-11-04 17:59:00 -0800 message: Simplify by assuming __fpending. Now that Emacs is using the gnulib fpending module, there's no need for Emacs to have a separate implementation. * configure.ac (stdio_ext.h, __fpending): Remove now-duplicate checks. (PENDING_OUTPUT_COUNT, DISPNEW_NEEDS_STDIO_EXT): Remove. * admin/CPP-DEFINES (PENDING_OUTPUT_COUNT): Remove. * src/dispnew.c: Include , not . (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT. Do not assume that __fpending's result fits in int. diff: === modified file 'ChangeLog' --- ChangeLog 2012-11-03 20:48:03 +0000 +++ ChangeLog 2012-11-05 01:59:00 +0000 @@ -1,3 +1,11 @@ +2012-11-05 Paul Eggert + + Simplify by assuming __fpending. + Now that Emacs is using the gnulib fpending module, + there's no need for Emacs to have a separate implementation. + * configure.ac (stdio_ext.h, __fpending): Remove now-duplicate checks. + (PENDING_OUTPUT_COUNT, DISPNEW_NEEDS_STDIO_EXT): Remove. + 2012-11-03 Eli Zaretskii * lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/fpending.$(O) and === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2012-09-16 21:43:55 +0000 +++ admin/CPP-DEFINES 2012-11-05 01:59:00 +0000 @@ -425,7 +425,6 @@ O_RDONLY O_RDWR PAGESIZE -PENDING_OUTPUT_COUNT PREFER_VSUSP PTY_ITERATION PTY_NAME_SPRINTF === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-11-03 19:19:05 +0000 +++ admin/ChangeLog 2012-11-05 01:59:00 +0000 @@ -1,3 +1,8 @@ +2012-11-05 Paul Eggert + + Simplify by assuming __fpending. + * CPP-DEFINES (PENDING_OUTPUT_COUNT): Remove. + 2012-11-03 Glenn Morris * admin.el (set-copyright): Add msdos/sed2v2.inp. === modified file 'configure.ac' --- configure.ac 2012-11-02 00:48:12 +0000 +++ configure.ac 2012-11-05 01:59:00 +0000 @@ -1266,7 +1266,7 @@ dnl checks for header files AC_CHECK_HEADERS_ONCE( linux/version.h sys/systeminfo.h - stdio_ext.h fcntl.h coff.h pty.h + fcntl.h coff.h pty.h sys/vlimit.h sys/resource.h sys/utsname.h pwd.h utmp.h dirent.h util.h) @@ -2874,7 +2874,7 @@ lrand48 setsid \ fpathconf select euidaccess getpagesize setlocale \ utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \ -__fpending strsignal setitimer \ +strsignal setitimer \ sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \ gai_strerror mkstemp getline getdelim fsync sync \ difftime posix_memalign \ @@ -3650,100 +3650,6 @@ esac -dnl Used in dispnew.c -AH_TEMPLATE(PENDING_OUTPUT_COUNT, [Number of chars of output in the - buffer of a stdio stream.]) - -AC_MSG_CHECKING([whether we are using the GNU C library]) -AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ -#include -#ifndef __GNU_LIBRARY__ -# error "this is not the GNU C library" -#endif - ]], [[]])], emacs_glibc=yes, emacs_glibc=no) -AC_MSG_RESULT([$emacs_glibc]) - -if test $emacs_glibc = yes; then - - emacs_pending_output=unknown - - case $opsys in - gnu | gnu-linux | gnu-kfreebsd ) - AC_MSG_CHECKING([for style of pending output formalism]) - dnl In autoconf 2.67 and later, we could use a single test - dnl since the preprocessed output is accessible in "conftest.i". - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ -#include -#if !defined (_IO_STDIO_H) && !defined (_STDIO_USES_IOSTREAM) -# error "stdio definitions not found" -#endif - ]], [[]])], emacs_pending_output=new, []) - - if test $emacs_pending_output = unknown; then - case $opsys in - gnu-linux | gnu-kfreebsd) - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ -#include -#ifndef __UCLIBC__ -# error "not using uclibc" -#endif - ]], [[]])], emacs_pending_output=uclibc, emacs_pending_output=old) - ;; - esac - fi - - AC_MSG_RESULT([$emacs_pending_output]) - - case $emacs_pending_output in - new) - dnl New C libio names. - AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), - [((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)]) - ;; - uclibc) - dnl Using the uClibc library. - AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), - [((FILE)->__bufpos - (FILE)->__bufstart)]) - ;; - old) - dnl Old C++ iostream names. - AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), - [((FILE)->_pptr - (FILE)->_pbase)]) - ;; - esac - ;; - esac dnl opsys - - if test $emacs_pending_output = unknown; then - AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__bufp - (FILE)->__buffer)]) - fi - -else dnl !emacs_glibc - - case $opsys in - cygwin | darwin | freebsd | netbsd | openbsd ) - AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_p - (FILE)->_bf._base)]) - ;; - - unixware) - AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__ptr - (FILE)->__base)]) - ;; - - *) - dnl HAVE_STDIO_EXT_H && HAVE___FPENDING - if test x$ac_cv_header_stdio_ext_h = xyes && \ - test x$ac_cv_func___fpending = xyes; then - AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [__fpending (FILE)]) - AC_DEFINE(DISPNEW_NEEDS_STDIO_EXT, 1, - [Define if dispnew.c should include stdio_ext.h.]) - else - AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_ptr - (FILE)->_base)]) - fi - ;; - esac -fi dnl emacs_glibc - - dnl Used in vm-limit.c AH_TEMPLATE(DATA_START, [Address of the start of the data segment.]) dnl Used in lisp.h, emacs.c, mem-limits.h === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-04 22:33:00 +0000 +++ src/ChangeLog 2012-11-05 01:59:00 +0000 @@ -1,3 +1,10 @@ +2012-11-05 Paul Eggert + + Simplify by assuming __fpending. + * dispnew.c: Include , not . + (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT. + Do not assume that __fpending's result fits in int. + 2012-11-04 Paul Eggert Remove EMACS_OUTQSIZE+sleep hack. === modified file 'src/dispnew.c' --- src/dispnew.c 2012-11-04 22:33:00 +0000 +++ src/dispnew.c 2012-11-05 01:59:00 +0000 @@ -53,9 +53,7 @@ #include "systime.h" #include -#ifdef DISPNEW_NEEDS_STDIO_EXT -#include -#endif +#include #if defined (HAVE_TERM_H) && defined (GNU_LINUX) #include /* for tgetent */ @@ -4647,7 +4645,7 @@ FILE *display_output = FRAME_TTY (f)->output; if (display_output) { - int outq = PENDING_OUTPUT_COUNT (display_output); + ptrdiff_t outq = __fpending (display_output); if (outq > 900 || (outq > 20 && ((i - 1) % preempt_count == 0))) fflush (display_output); ------------------------------------------------------------ revno: 110799 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-11-04 14:33:00 -0800 message: Remove EMACS_OUTQSIZE+sleep hack. * dispnew.c (update_frame_1): Remove hack for terminals slower than 2400 bps, which throttled Emacs by having it sleep. This code hasn't worked since at least 2007, when the multi-tty stuff was added, and anyway those old terminals are long dead. * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even without the dispnew.c change, as dispnew.c doesn't include systty.h. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-04 17:29:52 +0000 +++ src/ChangeLog 2012-11-04 22:33:00 +0000 @@ -1,5 +1,13 @@ 2012-11-04 Paul Eggert + Remove EMACS_OUTQSIZE+sleep hack. + * dispnew.c (update_frame_1): Remove hack for terminals slower + than 2400 bps, which throttled Emacs by having it sleep. This + code hasn't worked since at least 2007, when the multi-tty stuff + was added, and anyway those old terminals are long dead. + * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even + without the dispnew.c change, as dispnew.c doesn't include systty.h. + Fix data-loss with --version (Bug#9574). * emacs.c (close_output_streams): Use strerror, not emacs_strerror, as we can't assume that emacs_strerror is initialized, and strerror === modified file 'src/dispnew.c' --- src/dispnew.c 2012-11-02 10:34:26 +0000 +++ src/dispnew.c 2012-11-04 22:33:00 +0000 @@ -4650,21 +4650,7 @@ int outq = PENDING_OUTPUT_COUNT (display_output); if (outq > 900 || (outq > 20 && ((i - 1) % preempt_count == 0))) - { - fflush (display_output); - if (preempt_count == 1) - { -#ifdef EMACS_OUTQSIZE - if (EMACS_OUTQSIZE (0, &outq) < 0) - /* Probably not a tty. Ignore the error and reset - the outq count. */ - outq = PENDING_OUTPUT_COUNT (FRAME_TTY (f->output)); -#endif - outq *= 10; - if (baud_rate <= outq && baud_rate > 0) - sleep (outq / baud_rate); - } - } + fflush (display_output); } } === modified file 'src/systty.h' --- src/systty.h 2012-09-13 02:21:28 +0000 +++ src/systty.h 2012-11-04 22:33:00 +0000 @@ -52,17 +52,6 @@ #endif /* not CDEL */ #endif /* not _POSIX_VDISABLE */ -/* Get the number of characters queued for output. */ - -/* EMACS_OUTQSIZE(FD, int *SIZE) stores the number of characters - queued for output to the terminal FD in *SIZE, if FD is a tty. - Returns -1 if there was an error (i.e. FD is not a tty), 0 - otherwise. */ -#ifdef TIOCOUTQ -#define EMACS_OUTQSIZE(fd, size) (ioctl ((fd), TIOCOUTQ, (size))) -#endif - - /* Manipulate a terminal's current process group. */ /* EMACS_GETPGRP (arg) returns the process group of the process. */ ------------------------------------------------------------ revno: 110798 fixes bug: http://debbugs.gnu.org/9574 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-11-04 09:29:52 -0800 message: Fix data-loss with --version. * emacs.c (close_output_streams): Use strerror, not emacs_strerror, as we can't assume that emacs_strerror is initialized, and strerror is good enough here. (main): Invoke atexit earlier, to catch earlier instances of sending data to stdout and exiting, e.g., "emacs --version >/dev/full". diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-04 03:34:10 +0000 +++ src/ChangeLog 2012-11-04 17:29:52 +0000 @@ -1,3 +1,12 @@ +2012-11-04 Paul Eggert + + Fix data-loss with --version (Bug#9574). + * emacs.c (close_output_streams): Use strerror, not emacs_strerror, + as we can't assume that emacs_strerror is initialized, and strerror + is good enough here. + (main): Invoke atexit earlier, to catch earlier instances of + sending data to stdout and exiting, e.g., "emacs --version >/dev/full". + 2012-11-04 Michael Marchionna * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680). === modified file 'src/emacs.c' --- src/emacs.c 2012-11-03 18:54:17 +0000 +++ src/emacs.c 2012-11-04 17:29:52 +0000 @@ -684,7 +684,7 @@ if (close_stream (stdout) != 0) { fprintf (stderr, "Write error to standard output: %s\n", - emacs_strerror (errno)); + strerror (errno)); fflush (stderr); _exit (EXIT_FAILURE); } @@ -748,6 +748,8 @@ unexec_init_emacs_zone (); #endif + atexit (close_output_streams); + sort_args (argc, argv); argc = 0; while (argv[argc]) argc++; @@ -907,8 +909,6 @@ if (do_initial_setlocale) setlocale (LC_ALL, ""); - atexit (close_output_streams); - inhibit_window_system = 0; /* Handle the -t switch, which specifies filename to use as terminal. */ ------------------------------------------------------------ revno: 110797 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2012-11-04 13:44:58 +0100 message: nt/config.nt: Sync with autogen/config.in. (GNULIB_CLOSE_STREAM, HAVE_DECL___FPENDING): New macros. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-11-03 20:43:29 +0000 +++ nt/ChangeLog 2012-11-04 12:44:58 +0000 @@ -1,3 +1,8 @@ +2012-11-04 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (GNULIB_CLOSE_STREAM, HAVE_DECL___FPENDING): New macros. + 2012-11-03 Eli Zaretskii * config.nt (PENDING_OUTPUT_N_BYTES): Define. === modified file 'nt/config.nt' --- nt/config.nt 2012-11-03 20:43:29 +0000 +++ nt/config.nt 2012-11-04 12:44:58 +0000 @@ -197,6 +197,10 @@ /* #undef GLYPH_DEBUG */ /* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module close-stream shall be considered present. */ +#undef GNULIB_CLOSE_STREAM + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module fscanf shall be considered present. */ #undef GNULIB_FSCANF @@ -318,6 +322,10 @@ */ #define HAVE_DECL_TZNAME 1 +/* Define to 1 if you have the declaration of `__fpending', and to 0 if you + don't. */ +#undef HAVE_DECL___FPENDING + /* Define to 1 if you have the declaration of `__sys_siglist', and to 0 if you don't. */ #undef HAVE_DECL___SYS_SIGLIST ------------------------------------------------------------ revno: 110796 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-11-04 06:23:35 -0500 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/emacs-lisp/cl-loaddefs.el' --- lisp/emacs-lisp/cl-loaddefs.el 2012-10-30 10:18:56 +0000 +++ lisp/emacs-lisp/cl-loaddefs.el 2012-11-04 11:23:35 +0000 @@ -11,7 +11,7 @@ ;;;;;; cl--map-overlays cl--map-intervals cl--map-keymap-recursively ;;;;;; cl-notevery cl-notany cl-every cl-some cl-mapcon cl-mapcan ;;;;;; cl-mapl cl-mapc cl-maplist cl-map cl--mapcar-many cl-equalp -;;;;;; cl-coerce) "cl-extra" "cl-extra.el" "7d7f65d8a05e954a919fe2555b68fb05") +;;;;;; cl-coerce) "cl-extra" "cl-extra.el" "0e9284b6492cc98eee7c85ae4e5322ee") ;;; Generated autoloads from cl-extra.el (autoload 'cl-coerce "cl-extra" "\ @@ -265,7 +265,7 @@ ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) -;;;;;; "cl-macs" "cl-macs.el" "366e9efa4e3e7a81b2253e503611b23a") +;;;;;; "cl-macs" "cl-macs.el" "57cf89149db1e8ea6bc1582713980cf8") ;;; Generated autoloads from cl-macs.el (autoload 'cl--compiler-macro-list* "cl-macs" "\ @@ -473,9 +473,9 @@ (put 'cl-do-symbols 'lisp-indent-function '1) (autoload 'cl-do-all-symbols "cl-macs" "\ - - -\(fn SPEC &rest BODY)" nil t) +Like `cl-do-symbols', but use the default obarray. + +\(fn (VAR [RESULT]) BODY...)" nil t) (put 'cl-do-all-symbols 'lisp-indent-function '1) ------------------------------------------------------------ revno: 110795 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-11-04 06:19:07 -0500 message: Auto-commit of generated files. diff: === modified file 'autogen/Makefile.in' --- autogen/Makefile.in 2012-10-08 10:17:36 +0000 +++ autogen/Makefile.in 2012-11-04 11:19:07 +0000 @@ -36,7 +36,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub utimens warnings +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub utimens warnings VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -64,12 +64,14 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/c-strtod.m4 \ - $(top_srcdir)/m4/clock_time.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/clock_time.m4 \ + $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/dup2.m4 \ $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/execinfo.m4 \ $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/filemode.m4 \ - $(top_srcdir)/m4/getloadavg.m4 $(top_srcdir)/m4/getopt.m4 \ - $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/getloadavg.m4 \ + $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettime.m4 \ + $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inttypes.m4 \ @@ -111,17 +113,18 @@ am__DEPENDENCIES_1 = am__libgnu_a_SOURCES_DIST = allocator.c c-ctype.h c-ctype.c \ c-strcase.h c-strcasecmp.c c-strncasecmp.c careadlinkat.c \ - md5.c sha1.c sha256.c sha512.c dtoastr.c dtotimespec.c \ - filemode.c gettext.h gettime.c stat-time.c strftime.c \ - timespec.c timespec-add.c timespec-sub.c u64.c utimens.c + close-stream.c md5.c sha1.c sha256.c sha512.c dtoastr.c \ + dtotimespec.c filemode.c gettext.h gettime.c stat-time.c \ + strftime.c timespec.c timespec-add.c timespec-sub.c u64.c \ + utimens.c am__objects_1 = am_libgnu_a_OBJECTS = allocator.$(OBJEXT) c-ctype.$(OBJEXT) \ c-strcasecmp.$(OBJEXT) c-strncasecmp.$(OBJEXT) \ - careadlinkat.$(OBJEXT) md5.$(OBJEXT) sha1.$(OBJEXT) \ - sha256.$(OBJEXT) sha512.$(OBJEXT) dtoastr.$(OBJEXT) \ - dtotimespec.$(OBJEXT) filemode.$(OBJEXT) $(am__objects_1) \ - gettime.$(OBJEXT) stat-time.$(OBJEXT) strftime.$(OBJEXT) \ - timespec.$(OBJEXT) timespec-add.$(OBJEXT) \ + careadlinkat.$(OBJEXT) close-stream.$(OBJEXT) md5.$(OBJEXT) \ + sha1.$(OBJEXT) sha256.$(OBJEXT) sha512.$(OBJEXT) \ + dtoastr.$(OBJEXT) dtotimespec.$(OBJEXT) filemode.$(OBJEXT) \ + $(am__objects_1) gettime.$(OBJEXT) stat-time.$(OBJEXT) \ + strftime.$(OBJEXT) timespec.$(OBJEXT) timespec-add.$(OBJEXT) \ timespec-sub.$(OBJEXT) u64.$(OBJEXT) utimens.$(OBJEXT) libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp @@ -860,13 +863,13 @@ signal.h arg-nonnull.h c++defs.h warn-on-use.h $(STDALIGN_H) \ $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h \ stdlib.h sys/select.h sys/stat.h sys/time.h time.h unistd.h -EXTRA_DIST = alloca.in.h allocator.h careadlinkat.h md5.h sha1.h \ - sha256.h sha512.h dosname.h ftoastr.c ftoastr.h dup2.c \ - execinfo.c execinfo.in.h filemode.h getloadavg.c getopt.c \ - getopt.in.h getopt1.c getopt_int.h gettimeofday.c \ - ignore-value.h intprops.h inttypes.in.h lstat.c \ - mktime-internal.h mktime.c pathmax.h pselect.c \ - pthread_sigmask.c readlink.c signal.in.h \ +EXTRA_DIST = alloca.in.h allocator.h careadlinkat.h close-stream.h \ + md5.h sha1.h sha256.h sha512.h dosname.h ftoastr.c ftoastr.h \ + dup2.c execinfo.c execinfo.in.h filemode.h fpending.c \ + fpending.h getloadavg.c getopt.c getopt.in.h getopt1.c \ + getopt_int.h gettimeofday.c ignore-value.h intprops.h \ + inttypes.in.h lstat.c mktime-internal.h mktime.c pathmax.h \ + pselect.c pthread_sigmask.c readlink.c signal.in.h \ $(top_srcdir)/build-aux/snippet/_Noreturn.h \ $(top_srcdir)/build-aux/snippet/arg-nonnull.h \ $(top_srcdir)/build-aux/snippet/c++defs.h \ @@ -891,17 +894,17 @@ AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src libgnu_a_SOURCES = allocator.c c-ctype.h c-ctype.c c-strcase.h \ - c-strcasecmp.c c-strncasecmp.c careadlinkat.c md5.c sha1.c \ - sha256.c sha512.c dtoastr.c dtotimespec.c filemode.c \ - $(am__append_1) gettime.c stat-time.c strftime.c timespec.c \ - timespec-add.c timespec-sub.c u64.c utimens.c + c-strcasecmp.c c-strncasecmp.c careadlinkat.c close-stream.c \ + md5.c sha1.c sha256.c sha512.c dtoastr.c dtotimespec.c \ + filemode.c $(am__append_1) gettime.c stat-time.c strftime.c \ + timespec.c timespec-add.c timespec-sub.c u64.c utimens.c libgnu_a_LIBADD = $(gl_LIBOBJS) libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) -EXTRA_libgnu_a_SOURCES = ftoastr.c dup2.c execinfo.c getloadavg.c \ - getopt.c getopt1.c gettimeofday.c lstat.c mktime.c pselect.c \ - pthread_sigmask.c readlink.c stat.c strtoimax.c strtol.c \ - strtoll.c strtol.c strtoul.c strtoull.c strtoimax.c \ - strtoumax.c symlink.c time_r.c +EXTRA_libgnu_a_SOURCES = ftoastr.c dup2.c execinfo.c fpending.c \ + getloadavg.c getopt.c getopt1.c gettimeofday.c lstat.c \ + mktime.c pselect.c pthread_sigmask.c readlink.c stat.c \ + strtoimax.c strtol.c strtoll.c strtol.c strtoul.c strtoull.c \ + strtoimax.c strtoumax.c symlink.c time_r.c # Because this Makefile snippet defines a variable used by other # gnulib Makefile snippets, it must be present in all Makefile.am that @@ -964,11 +967,13 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strcasecmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strncasecmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/careadlinkat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtoastr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtotimespec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpending.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftoastr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getloadavg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ === modified file 'autogen/aclocal.m4' --- autogen/aclocal.m4 2012-09-27 10:17:43 +0000 +++ autogen/aclocal.m4 2012-11-04 11:19:07 +0000 @@ -988,12 +988,14 @@ m4_include([m4/alloca.m4]) m4_include([m4/c-strtod.m4]) m4_include([m4/clock_time.m4]) +m4_include([m4/close-stream.m4]) m4_include([m4/dup2.m4]) m4_include([m4/environ.m4]) m4_include([m4/execinfo.m4]) m4_include([m4/extensions.m4]) m4_include([m4/extern-inline.m4]) m4_include([m4/filemode.m4]) +m4_include([m4/fpending.m4]) m4_include([m4/getloadavg.m4]) m4_include([m4/getopt.m4]) m4_include([m4/gettime.m4]) === modified file 'autogen/config.in' --- autogen/config.in 2012-10-24 10:17:36 +0000 +++ autogen/config.in 2012-11-04 11:19:07 +0000 @@ -191,6 +191,10 @@ #undef GLYPH_DEBUG /* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module close-stream shall be considered present. */ +#undef GNULIB_CLOSE_STREAM + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module fscanf shall be considered present. */ #undef GNULIB_FSCANF @@ -312,6 +316,10 @@ */ #undef HAVE_DECL_TZNAME +/* Define to 1 if you have the declaration of `__fpending', and to 0 if you + don't. */ +#undef HAVE_DECL___FPENDING + /* Define to 1 if you have the declaration of `__sys_siglist', and to 0 if you don't. */ #undef HAVE_DECL___SYS_SIGLIST @@ -1209,6 +1217,9 @@ /* Number of chars of output in the buffer of a stdio stream. */ #undef PENDING_OUTPUT_COUNT +/* the number of pending output bytes on stream 'fp' */ +#undef PENDING_OUTPUT_N_BYTES + /* Define to empty to suppress deprecation warnings when building with --enable-gcc-warnings and with libpng versions before 1.5, which lack png_longjmp. */ === modified file 'autogen/configure' --- autogen/configure 2012-11-02 10:17:32 +0000 +++ autogen/configure 2012-11-04 11:19:07 +0000 @@ -3206,6 +3206,7 @@ as_fn_append ac_func_list " tzset" as_fn_append ac_func_list " readlinkat" as_fn_append ac_header_list " execinfo.h" +as_fn_append ac_func_list " __fpending" gl_getopt_required=GNU as_fn_append ac_header_list " getopt.h" as_fn_append ac_func_list " gettimeofday" @@ -6958,6 +6959,7 @@ # Code from module c-strcase: # Code from module careadlinkat: # Code from module clock-time: + # Code from module close-stream: # Code from module crypto/md5: # Code from module crypto/sha1: # Code from module crypto/sha256: @@ -6972,6 +6974,7 @@ # Code from module extern-inline: # Code from module filemode: + # Code from module fpending: # Code from module getloadavg: # Code from module getopt-gnu: # Code from module getopt-posix: @@ -16999,6 +17002,8 @@ _ACEOF + + GNULIB__EXIT=0; GNULIB_ATOLL=0; GNULIB_CALLOC_POSIX=0; @@ -20448,6 +20453,16 @@ LIBS=$gl_saved_libs + : + + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_CLOSE_STREAM 1 +_ACEOF + + + : @@ -20687,6 +20702,120 @@ + + fp_headers=' +# include +# if HAVE_STDIO_EXT_H +# include +# endif +' + ac_fn_c_check_decl "$LINENO" "__fpending" "ac_cv_have_decl___fpending" "$fp_headers +" +if test "x$ac_cv_have_decl___fpending" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL___FPENDING $ac_have_decl +_ACEOF + + + if test $ac_cv_func___fpending = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fpending.$ac_objext" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to determine the number of pending output bytes on a stream" >&5 +$as_echo_n "checking how to determine the number of pending output bytes on a stream... " >&6; } +if test "${ac_cv_sys_pending_output_n_bytes+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + for ac_expr in \ + \ + '# glibc2' \ + 'fp->_IO_write_ptr - fp->_IO_write_base' \ + \ + '# traditional Unix' \ + 'fp->_ptr - fp->_base' \ + \ + '# BSD' \ + 'fp->_p - fp->_bf._base' \ + \ + '# SCO, Unixware' \ + '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \ + \ + '# QNX' \ + '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \ + \ + '# old glibc?' \ + 'fp->__bufp - fp->__buffer' \ + \ + '# old glibc iostream?' \ + 'fp->_pptr - fp->_pbase' \ + \ + '# emx+gcc' \ + 'fp->_ptr - fp->_buffer' \ + \ + '# Minix' \ + 'fp->_ptr - fp->_buf' \ + \ + '# Plan9' \ + 'fp->wp - fp->buf' \ + \ + '# VMS' \ + '(*fp)->_ptr - (*fp)->_base' \ + \ + '# e.g., DGUX R4.11; the info is not available' \ + 1 \ + ; do + + # Skip each embedded comment. + case "$ac_expr" in '#'*) continue;; esac + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *fp = stdin; (void) ($ac_expr); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + fp_done=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$fp_done" = yes && break + done + + ac_cv_sys_pending_output_n_bytes=$ac_expr + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_pending_output_n_bytes" >&5 +$as_echo "$ac_cv_sys_pending_output_n_bytes" >&6; } + +cat >>confdefs.h <<_ACEOF +#define PENDING_OUTPUT_N_BYTES $ac_cv_sys_pending_output_n_bytes +_ACEOF + + + fi + + # Persuade glibc to declare getloadavg(). ------------------------------------------------------------ revno: 110794 fixes bug: http://debbugs.gnu.org/7850 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-11-03 21:13:13 -0700 message: * lisp/vc/vc-svn.el (vc-svn-state-heuristic): Avoid calling svn. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-04 03:25:18 +0000 +++ lisp/ChangeLog 2012-11-04 04:13:13 +0000 @@ -1,3 +1,7 @@ +2012-11-04 Glenn Morris + + * vc/vc-svn.el (vc-svn-state-heuristic): Avoid calling svn. (Bug#7850) + 2012-11-04 Chong Yidong * bookmark.el (bookmark-bmenu-switch-other-window): Avoid binding === modified file 'lisp/vc/vc-svn.el' --- lisp/vc/vc-svn.el 2012-02-25 04:29:09 +0000 +++ lisp/vc/vc-svn.el 2012-11-04 04:13:13 +0000 @@ -155,9 +155,24 @@ (vc-svn-command t 0 file "status" (if localp "-v" "-u")) (vc-svn-parse-status file)))) +;; NB this does not handle svn properties, which can be changed +;; without changing the file timestamp. +;; Note that unlike vc-cvs-state-heuristic, this is not called from +;; vc-svn-state. AFAICS, it is only called from vc-state-refresh via +;; vc-after-save (bug#7850). Therefore the fact that it ignores +;; properties is irrelevant. If you want to make vc-svn-state call +;; this, it should be extended to handle svn properties. (defun vc-svn-state-heuristic (file) "SVN-specific state heuristic." - (vc-svn-state file 'local)) + ;; If the file has not changed since checkout, consider it `up-to-date'. + ;; Otherwise consider it `edited'. Copied from vc-cvs-state-heuristic. + (let ((checkout-time (vc-file-getprop file 'vc-checkout-time)) + (lastmod (nth 5 (file-attributes file)))) + (cond + ((equal checkout-time lastmod) 'up-to-date) + ((string= (vc-working-revision file) "0") 'added) + ((null checkout-time) 'unregistered) + (t 'edited)))) ;; FIXME it would be better not to have the "remote" argument, ;; but to distinguish the two output formats based on content.