Commit 2b9c78ca authored by Jason Madden's avatar Jason Madden

Update libev to 4.23

parent cd1defa6
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
1.2a2 (unreleased) 1.2a2 (unreleased)
================== ==================
- Nothing yet. - Update libev to version 4.23.
1.2a1 (Oct 27, 2016) 1.2a1 (Oct 27, 2016)
==================== ====================
......
Revision history for libev, a high-performance and full-featured event loop. Revision history for libev, a high-performance and full-featured event loop.
TODO: ev_loop_wakeup 4.23 Wed Nov 16 18:23:41 CET 2016
TODO: EV_STANDALONE == NO_HASSEL (do not use clock_gettime in ev_standalone) - move some declarations at the beginning to help certain retarded
TODO: faq, process a thing in each iteration microsoft compilers, even though their documentation claims
TODO: dbeugging tips, ev_verify, ev_init twice otherwise (reported by Ruslan Osmanov).
TODO: ev_break for immediate exit (EVBREAK_NOW?)
TODO: ev_feed_child_event
TODO: document the special problem of signals around fork.
TODO: store pid for each signal
TODO: document file descriptor usage per loop
TODO: store loop pid_t and compare isndie signal handler,store 1 for same, 2 for differign pid, clean up in loop_fork
TODO: embed watchers need updating when fd changes
TODO: document portability requirements for atomic pointer access
TODO: document requirements for function pointers and calling conventions.
4.22 Sun Dec 20 22:11:50 CET 2015 4.22 Sun Dec 20 22:11:50 CET 2015
- when epoll detects unremovable fds in the fd set, rebuild - when epoll detects unremovable fds in the fd set, rebuild
......
# Makefile.in generated by automake 1.14.1 from Makefile.am. # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc. # Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
...@@ -16,7 +16,17 @@ ...@@ -16,7 +16,17 @@
VPATH = @srcdir@ VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \ am__make_running_with_option = \
case $${target_option-} in \ case $${target_option-} in \
?) ;; \ ?) ;; \
...@@ -80,16 +90,13 @@ POST_UNINSTALL = : ...@@ -80,16 +90,13 @@ POST_UNINSTALL = :
build_triplet = @build@ build_triplet = @build@
host_triplet = @host@ host_triplet = @host@
subdir = . subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/config.h.in mkinstalldirs depcomp $(include_HEADERS) \
README compile config.guess config.sub install-sh missing \
ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/libev.m4 \ am__aclocal_m4_deps = $(top_srcdir)/libev.m4 \
$(top_srcdir)/configure.ac $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4) $(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(include_HEADERS) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
...@@ -203,6 +210,9 @@ ETAGS = etags ...@@ -203,6 +210,9 @@ ETAGS = etags
CTAGS = ctags CTAGS = ctags
CSCOPE = cscope CSCOPE = cscope
AM_RECURSIVE_TARGETS = cscope AM_RECURSIVE_TARGETS = cscope
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in README \
TODO compile config.guess config.sub depcomp install-sh \
ltmain.sh missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION) distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir) top_distdir = $(distdir)
...@@ -327,6 +337,7 @@ pdfdir = @pdfdir@ ...@@ -327,6 +337,7 @@ pdfdir = @pdfdir@
prefix = @prefix@ prefix = @prefix@
program_transform_name = @program_transform_name@ program_transform_name = @program_transform_name@
psdir = @psdir@ psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@ srcdir = @srcdir@
...@@ -367,7 +378,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi ...@@ -367,7 +378,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \ $(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile $(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \ @case '$?' in \
*config.status*) \ *config.status*) \
...@@ -658,15 +668,15 @@ dist-xz: distdir ...@@ -658,15 +668,15 @@ dist-xz: distdir
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-tarZ: distdir dist-tarZ: distdir
@echo WARNING: "Support for shar distribution archives is" \ @echo WARNING: "Support for distribution archives compressed with" \
"deprecated." >&2 "legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-shar: distdir dist-shar: distdir
@echo WARNING: "Support for distribution archives compressed with" \ @echo WARNING: "Support for shar distribution archives is" \
"legacy program 'compress' is deprecated." >&2 "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir) $(am__post_remove_distdir)
...@@ -702,17 +712,17 @@ distcheck: dist ...@@ -702,17 +712,17 @@ distcheck: dist
esac esac
chmod -R a-w $(distdir) chmod -R a-w $(distdir)
chmod u+w $(distdir) chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir) chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \ test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \ && am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \ && $(am__cd) $(distdir)/_build/sub \
&& ../configure \ && ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=.. --prefix="$$dc_install_base" \ --srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) check \
...@@ -900,6 +910,8 @@ uninstall-man: uninstall-man3 ...@@ -900,6 +910,8 @@ uninstall-man: uninstall-man3
uninstall-am uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-am uninstall-includeHEADERS uninstall-libLTLIBRARIES \
uninstall-man uninstall-man3 uninstall-man uninstall-man3
.PRECIOUS: Makefile
ev.3: ev.pod ev.3: ev.pod
pod2man -n LIBEV -r "libev-$(VERSION)" -c "libev - high performance full featured event loop" -s3 <$< >$@ pod2man -n LIBEV -r "libev-$(VERSION)" -c "libev - high performance full featured event loop" -s3 <$< >$@
......
...@@ -729,6 +729,7 @@ infodir ...@@ -729,6 +729,7 @@ infodir
docdir docdir
oldincludedir oldincludedir
includedir includedir
runstatedir
localstatedir localstatedir
sharedstatedir sharedstatedir
sysconfdir sysconfdir
...@@ -809,6 +810,7 @@ datadir='${datarootdir}' ...@@ -809,6 +810,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc' sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com' sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var' localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include' includedir='${prefix}/include'
oldincludedir='/usr/include' oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE}' docdir='${datarootdir}/doc/${PACKAGE}'
...@@ -1061,6 +1063,15 @@ do ...@@ -1061,6 +1063,15 @@ do
| -silent | --silent | --silen | --sile | --sil) | -silent | --silent | --silen | --sile | --sil)
silent=yes ;; silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;; ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
...@@ -1198,7 +1209,7 @@ fi ...@@ -1198,7 +1209,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \ datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir libdir localedir mandir runstatedir
do do
eval ac_val=\$$ac_var eval ac_val=\$$ac_var
# Remove trailing slashes. # Remove trailing slashes.
...@@ -1351,6 +1362,7 @@ Fine tuning of the installation directories: ...@@ -1351,6 +1362,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var] --localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib] --libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include] --includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include] --oldincludedir=DIR C header files for non-gcc [/usr/include]
...@@ -2205,7 +2217,7 @@ orig_CFLAGS="$CFLAGS" ...@@ -2205,7 +2217,7 @@ orig_CFLAGS="$CFLAGS"
am__api_version='1.14' am__api_version='1.15'
ac_aux_dir= ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
...@@ -2426,7 +2438,7 @@ else ...@@ -2426,7 +2438,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi fi
if test x"${install_sh}" != xset; then if test x"${install_sh+set}" != xset; then
case $am_aux_dir in case $am_aux_dir in
*\ * | *\ *) *\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
...@@ -2721,7 +2733,7 @@ fi ...@@ -2721,7 +2733,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE=libev PACKAGE=libev
VERSION=4.22 VERSION=4.23
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
...@@ -2755,8 +2767,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} ...@@ -2755,8 +2767,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)' mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target. The system "awk" is bad on # We need awk for the "check" target (and possibly the TAP driver). The
# some platforms. # system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used # Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ... # in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}' AMTAR='$${TAR-tar}'
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
scriptversion=2013-05-30.07; # UTC scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc. # Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
......
.\" Automatically generated by Pod::Man 4.06 (Pod::Simple 3.32) .\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\" .\"
.\" Standard preamble: .\" Standard preamble:
.\" ======================================================================== .\" ========================================================================
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
.ie \n(.g .ds Aq \(aq .ie \n(.g .ds Aq \(aq
.el .ds Aq ' .el .ds Aq '
.\" .\"
.\" If the F register is >0, we'll generate index entries on stderr for .\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the .\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion. .\" output yourself in some meaningful fashion.
...@@ -54,16 +54,20 @@ ...@@ -54,16 +54,20 @@
.\" Avoid warning from groff about undefined register 'F'. .\" Avoid warning from groff about undefined register 'F'.
.de IX .de IX
.. ..
.if !\nF .nr F 0 .nr rF 0
.if \nF>0 \{\ .if \n(.g .if rF .nr rF 1
. de IX .if (\n(rF:(\n(.g==0)) \{
. tm Index:\\$1\t\\n%\t"\\$2" . if \nF \{
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
.. ..
. if !\nF==2 \{\ . if !\nF==2 \{
. nr % 0 . nr % 0
. nr F 2 . nr F 2
. \}
. \} . \}
.\} .\}
.rr rF
.\" .\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts. .\" Fear. Run. Save yourself. No user-serviceable parts.
...@@ -129,7 +133,7 @@ ...@@ -129,7 +133,7 @@
.\" ======================================================================== .\" ========================================================================
.\" .\"
.IX Title "LIBEV 3" .IX Title "LIBEV 3"
.TH LIBEV 3 "2016-03-09" "libev-4.22" "libev - high performance full featured event loop" .TH LIBEV 3 "2016-11-16" "libev-4.23" "libev - high performance full featured event loop"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents. .\" way too many mistakes in technical documents.
.if n .ad l .if n .ad l
...@@ -2344,7 +2348,7 @@ Periodic watchers are also timers of a kind, but they are very versatile ...@@ -2344,7 +2348,7 @@ Periodic watchers are also timers of a kind, but they are very versatile
.PP .PP
Unlike \f(CW\*(C`ev_timer\*(C'\fR, periodic watchers are not based on real time (or Unlike \f(CW\*(C`ev_timer\*(C'\fR, periodic watchers are not based on real time (or
relative time, the physical time that passes) but on wall clock time relative time, the physical time that passes) but on wall clock time
(absolute time, the thing you can read on your calender or clock). The (absolute time, the thing you can read on your calendar or clock). The
difference is that wall clock time can run faster or slower than real difference is that wall clock time can run faster or slower than real
time, and time jumps are not uncommon (e.g. when you adjust your time, and time jumps are not uncommon (e.g. when you adjust your
wrist-watch). wrist-watch).
...@@ -5410,6 +5414,10 @@ structure (guaranteed by \s-1POSIX\s0 but not by \s-1ISO C\s0 for example), but ...@@ -5410,6 +5414,10 @@ structure (guaranteed by \s-1POSIX\s0 but not by \s-1ISO C\s0 for example), but
assumes that the same (machine) code can be used to call any watcher assumes that the same (machine) code can be used to call any watcher
callback: The watcher callbacks have different type signatures, but libev callback: The watcher callbacks have different type signatures, but libev
calls them using an \f(CW\*(C`ev_watcher *\*(C'\fR internally. calls them using an \f(CW\*(C`ev_watcher *\*(C'\fR internally.
.IP "null pointers and integer zero are represented by 0 bytes" 4
.IX Item "null pointers and integer zero are represented by 0 bytes"
Libev uses \f(CW\*(C`memset\*(C'\fR to initialise structs and arrays to \f(CW0\fR bytes, and
relies on this setting pointers and integers to null.
.IP "pointer accesses must be thread-atomic" 4 .IP "pointer accesses must be thread-atomic" 4
.IX Item "pointer accesses must be thread-atomic" .IX Item "pointer accesses must be thread-atomic"
Accessing a pointer value must be atomic, it must both be readable and Accessing a pointer value must be atomic, it must both be readable and
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
# undef EV_USE_POLL # undef EV_USE_POLL
# define EV_USE_POLL 0 # define EV_USE_POLL 0
# endif # endif
# if HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H # if HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H
# ifndef EV_USE_EPOLL # ifndef EV_USE_EPOLL
# define EV_USE_EPOLL EV_FEATURE_BACKENDS # define EV_USE_EPOLL EV_FEATURE_BACKENDS
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
# undef EV_USE_EPOLL # undef EV_USE_EPOLL
# define EV_USE_EPOLL 0 # define EV_USE_EPOLL 0
# endif # endif
# if HAVE_KQUEUE && HAVE_SYS_EVENT_H # if HAVE_KQUEUE && HAVE_SYS_EVENT_H
# ifndef EV_USE_KQUEUE # ifndef EV_USE_KQUEUE
# define EV_USE_KQUEUE EV_FEATURE_BACKENDS # define EV_USE_KQUEUE EV_FEATURE_BACKENDS
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
# undef EV_USE_KQUEUE # undef EV_USE_KQUEUE
# define EV_USE_KQUEUE 0 # define EV_USE_KQUEUE 0
# endif # endif
# if HAVE_PORT_H && HAVE_PORT_CREATE # if HAVE_PORT_H && HAVE_PORT_CREATE
# ifndef EV_USE_PORT # ifndef EV_USE_PORT
# define EV_USE_PORT EV_FEATURE_BACKENDS # define EV_USE_PORT EV_FEATURE_BACKENDS
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
# undef EV_USE_EVENTFD # undef EV_USE_EVENTFD
# define EV_USE_EVENTFD 0 # define EV_USE_EVENTFD 0
# endif # endif
#endif #endif
#include <stdlib.h> #include <stdlib.h>
...@@ -2320,7 +2320,7 @@ downheap (ANHE *heap, int N, int k) ...@@ -2320,7 +2320,7 @@ downheap (ANHE *heap, int N, int k)
heap [k] = heap [c]; heap [k] = heap [c];
ev_active (ANHE_w (heap [k])) = k; ev_active (ANHE_w (heap [k])) = k;
k = c; k = c;
} }
...@@ -2743,7 +2743,7 @@ ev_supported_backends (void) EV_THROW ...@@ -2743,7 +2743,7 @@ ev_supported_backends (void) EV_THROW
if (EV_USE_EPOLL ) flags |= EVBACKEND_EPOLL; if (EV_USE_EPOLL ) flags |= EVBACKEND_EPOLL;
if (EV_USE_POLL ) flags |= EVBACKEND_POLL; if (EV_USE_POLL ) flags |= EVBACKEND_POLL;
if (EV_USE_SELECT) flags |= EVBACKEND_SELECT; if (EV_USE_SELECT) flags |= EVBACKEND_SELECT;
return flags; return flags;
} }
...@@ -5140,3 +5140,4 @@ ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)) EV_THROW ...@@ -5140,3 +5140,4 @@ ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)) EV_THROW
#if EV_MULTIPLICITY #if EV_MULTIPLICITY
#include "ev_wrap.h" #include "ev_wrap.h"
#endif #endif
...@@ -515,10 +515,10 @@ enum { ...@@ -515,10 +515,10 @@ enum {
/* method bits to be ored together */ /* method bits to be ored together */
enum { enum {
EVBACKEND_SELECT = 0x00000001U, /* about anywhere */ EVBACKEND_SELECT = 0x00000001U, /* available just about anywhere */
EVBACKEND_POLL = 0x00000002U, /* !win */ EVBACKEND_POLL = 0x00000002U, /* !win, !aix, broken on osx */
EVBACKEND_EPOLL = 0x00000004U, /* linux */ EVBACKEND_EPOLL = 0x00000004U, /* linux */
EVBACKEND_KQUEUE = 0x00000008U, /* bsd */ EVBACKEND_KQUEUE = 0x00000008U, /* bsd, broken on osx */
EVBACKEND_DEVPOLL = 0x00000010U, /* solaris 8 */ /* NYI */ EVBACKEND_DEVPOLL = 0x00000010U, /* solaris 8 */ /* NYI */
EVBACKEND_PORT = 0x00000020U, /* solaris 10 */ EVBACKEND_PORT = 0x00000020U, /* solaris 10 */
EVBACKEND_ALL = 0x0000003FU, /* all known backends */ EVBACKEND_ALL = 0x0000003FU, /* all known backends */
......
...@@ -2211,7 +2211,7 @@ Periodic watchers are also timers of a kind, but they are very versatile ...@@ -2211,7 +2211,7 @@ Periodic watchers are also timers of a kind, but they are very versatile
Unlike C<ev_timer>, periodic watchers are not based on real time (or Unlike C<ev_timer>, periodic watchers are not based on real time (or
relative time, the physical time that passes) but on wall clock time relative time, the physical time that passes) but on wall clock time
(absolute time, the thing you can read on your calender or clock). The (absolute time, the thing you can read on your calendar or clock). The
difference is that wall clock time can run faster or slower than real difference is that wall clock time can run faster or slower than real
time, and time jumps are not uncommon (e.g. when you adjust your time, and time jumps are not uncommon (e.g. when you adjust your
wrist-watch). wrist-watch).
...@@ -5302,6 +5302,11 @@ assumes that the same (machine) code can be used to call any watcher ...@@ -5302,6 +5302,11 @@ assumes that the same (machine) code can be used to call any watcher
callback: The watcher callbacks have different type signatures, but libev callback: The watcher callbacks have different type signatures, but libev
calls them using an C<ev_watcher *> internally. calls them using an C<ev_watcher *> internally.
=item null pointers and integer zero are represented by 0 bytes
Libev uses C<memset> to initialise structs and arrays to C<0> bytes, and
relies on this setting pointers and integers to null.
=item pointer accesses must be thread-atomic =item pointer accesses must be thread-atomic
Accessing a pointer value must be atomic, it must both be readable and Accessing a pointer value must be atomic, it must both be readable and
......
...@@ -235,7 +235,8 @@ epoll_poll (EV_P_ ev_tstamp timeout) ...@@ -235,7 +235,8 @@ epoll_poll (EV_P_ ev_tstamp timeout)
} }
} }
int inline_size inline_size
int
epoll_init (EV_P_ int flags) epoll_init (EV_P_ int flags)
{ {
#ifdef EPOLL_CLOEXEC #ifdef EPOLL_CLOEXEC
...@@ -260,14 +261,16 @@ epoll_init (EV_P_ int flags) ...@@ -260,14 +261,16 @@ epoll_init (EV_P_ int flags)
return EVBACKEND_EPOLL; return EVBACKEND_EPOLL;
} }
void inline_size inline_size
void
epoll_destroy (EV_P) epoll_destroy (EV_P)
{ {
ev_free (epoll_events); ev_free (epoll_events);
array_free (epoll_eperm, EMPTY); array_free (epoll_eperm, EMPTY);
} }
void inline_size inline_size
void
epoll_fork (EV_P) epoll_fork (EV_P)
{ {
close (backend_fd); close (backend_fd);
......
...@@ -43,7 +43,8 @@ ...@@ -43,7 +43,8 @@
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
void inline_speed inline_speed
void
kqueue_change (EV_P_ int fd, int filter, int flags, int fflags) kqueue_change (EV_P_ int fd, int filter, int flags, int fflags)
{ {
++kqueue_changecnt; ++kqueue_changecnt;
...@@ -152,7 +153,8 @@ kqueue_poll (EV_P_ ev_tstamp timeout) ...@@ -152,7 +153,8 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
} }
} }
int inline_size inline_size
int
kqueue_init (EV_P_ int flags) kqueue_init (EV_P_ int flags)
{ {
/* initialize the kernel queue */ /* initialize the kernel queue */
...@@ -176,14 +178,16 @@ kqueue_init (EV_P_ int flags) ...@@ -176,14 +178,16 @@ kqueue_init (EV_P_ int flags)
return EVBACKEND_KQUEUE; return EVBACKEND_KQUEUE;
} }
void inline_size inline_size
void
kqueue_destroy (EV_P) kqueue_destroy (EV_P)
{ {
ev_free (kqueue_events); ev_free (kqueue_events);
ev_free (kqueue_changes); ev_free (kqueue_changes);
} }
void inline_size inline_size
void
kqueue_fork (EV_P) kqueue_fork (EV_P)
{ {
/* some BSD kernels don't just destroy the kqueue itself, /* some BSD kernels don't just destroy the kqueue itself,
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
#include <poll.h> #include <poll.h>
void inline_size inline_size
void
pollidx_init (int *base, int count) pollidx_init (int *base, int count)
{ {
/* consider using memset (.., -1, ...), which is practically guaranteed /* consider using memset (.., -1, ...), which is practically guaranteed
...@@ -126,7 +127,8 @@ poll_poll (EV_P_ ev_tstamp timeout) ...@@ -126,7 +127,8 @@ poll_poll (EV_P_ ev_tstamp timeout)
} }
} }
int inline_size inline_size
int
poll_init (EV_P_ int flags) poll_init (EV_P_ int flags)
{ {
backend_mintime = 1e-3; backend_mintime = 1e-3;
...@@ -139,7 +141,8 @@ poll_init (EV_P_ int flags) ...@@ -139,7 +141,8 @@ poll_init (EV_P_ int flags)
return EVBACKEND_POLL; return EVBACKEND_POLL;
} }
void inline_size inline_size
void
poll_destroy (EV_P) poll_destroy (EV_P)
{ {
ev_free (pollidxs); ev_free (pollidxs);
......
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
void inline_speed inline_speed
void
port_associate_and_check (EV_P_ int fd, int ev) port_associate_and_check (EV_P_ int fd, int ev)
{ {
if (0 > if (0 >
...@@ -136,7 +137,8 @@ port_poll (EV_P_ ev_tstamp timeout) ...@@ -136,7 +137,8 @@ port_poll (EV_P_ ev_tstamp timeout)
} }
} }
int inline_size inline_size
int
port_init (EV_P_ int flags) port_init (EV_P_ int flags)
{ {
/* Initialize the kernel queue */ /* Initialize the kernel queue */
...@@ -163,13 +165,15 @@ port_init (EV_P_ int flags) ...@@ -163,13 +165,15 @@ port_init (EV_P_ int flags)
return EVBACKEND_PORT; return EVBACKEND_PORT;
} }
void inline_size inline_size
void
port_destroy (EV_P) port_destroy (EV_P)
{ {
ev_free (port_events); ev_free (port_events);
} }
void inline_size inline_size
void
port_fork (EV_P) port_fork (EV_P)
{ {
close (backend_fd); close (backend_fd);
......
...@@ -271,7 +271,8 @@ select_poll (EV_P_ ev_tstamp timeout) ...@@ -271,7 +271,8 @@ select_poll (EV_P_ ev_tstamp timeout)
#endif #endif
} }
int inline_size inline_size
int
select_init (EV_P_ int flags) select_init (EV_P_ int flags)
{ {
backend_mintime = 1e-6; backend_mintime = 1e-6;
...@@ -300,7 +301,8 @@ select_init (EV_P_ int flags) ...@@ -300,7 +301,8 @@ select_init (EV_P_ int flags)
return EVBACKEND_SELECT; return EVBACKEND_SELECT;
} }
void inline_size inline_size
void
select_destroy (EV_P) select_destroy (EV_P)
{ {
ev_free (vec_ri); ev_free (vec_ri);
......
#!/bin/sh #!/bin/sh
# install - install a program, script, or datafile # install - install a program, script, or datafile
scriptversion=2011-11-20.07; # UTC scriptversion=2014-09-12.12; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was # This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the # later released in X11R6 (xc/config/util/install.sh) with the
...@@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC ...@@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
# This script is compatible with the BSD install script, but was written # This script is compatible with the BSD install script, but was written
# from scratch. # from scratch.
tab=' '
nl=' nl='
' '
IFS=" "" $nl" IFS=" $tab$nl"
# set DOITPROG to echo to test this script # Set DOITPROG to "echo" to test this script.
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-} doit=${DOITPROG-}
if test -z "$doit"; then doit_exec=${doit:-exec}
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path; # Put in absolute file names if you don't have them in your path;
# or use environment vars. # or use environment vars.
...@@ -68,17 +64,6 @@ mvprog=${MVPROG-mv} ...@@ -68,17 +64,6 @@ mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm} rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip} stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir= posix_mkdir=
# Desired mode of installed file. # Desired mode of installed file.
...@@ -97,7 +82,7 @@ dir_arg= ...@@ -97,7 +82,7 @@ dir_arg=
dst_arg= dst_arg=
copy_on_change=false copy_on_change=false
no_target_directory= is_target_a_directory=possibly
usage="\ usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
...@@ -137,46 +122,57 @@ while test $# -ne 0; do ...@@ -137,46 +122,57 @@ while test $# -ne 0; do
-d) dir_arg=true;; -d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2" -g) chgrpcmd="$chgrpprog $2"
shift;; shift;;
--help) echo "$usage"; exit $?;; --help) echo "$usage"; exit $?;;
-m) mode=$2 -m) mode=$2
case $mode in case $mode in
*' '* | *' '* | *' *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
'* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2
echo "$0: invalid mode: $mode" >&2 exit 1;;
exit 1;; esac
esac shift;;
shift;;
-o) chowncmd="$chownprog $2" -o) chowncmd="$chownprog $2"
shift;; shift;;
-s) stripcmd=$stripprog;; -s) stripcmd=$stripprog;;
-t) dst_arg=$2 -t)
# Protect names problematic for 'test' and other utilities. is_target_a_directory=always
case $dst_arg in dst_arg=$2
-* | [=\(\)!]) dst_arg=./$dst_arg;; # Protect names problematic for 'test' and other utilities.
esac case $dst_arg in
shift;; -* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true;; -T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;; --version) echo "$0 $scriptversion"; exit $?;;
--) shift --) shift
break;; break;;
-*) echo "$0: invalid option: $1" >&2 -*) echo "$0: invalid option: $1" >&2
exit 1;; exit 1;;
*) break;; *) break;;
esac esac
shift shift
done done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create. # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified. # When -t is used, the destination is already specified.
...@@ -207,6 +203,15 @@ if test $# -eq 0; then ...@@ -207,6 +203,15 @@ if test $# -eq 0; then
exit 0 exit 0
fi fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret' do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1 trap "ret=129; $do_exit" 1
...@@ -223,16 +228,16 @@ if test -z "$dir_arg"; then ...@@ -223,16 +228,16 @@ if test -z "$dir_arg"; then
*[0-7]) *[0-7])
if test -z "$stripcmd"; then if test -z "$stripcmd"; then
u_plus_rw= u_plus_rw=
else else
u_plus_rw='% 200' u_plus_rw='% 200'
fi fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*) *)
if test -z "$stripcmd"; then if test -z "$stripcmd"; then
u_plus_rw= u_plus_rw=
else else
u_plus_rw=,u+rw u_plus_rw=,u+rw
fi fi
cp_umask=$mode$u_plus_rw;; cp_umask=$mode$u_plus_rw;;
esac esac
...@@ -269,41 +274,15 @@ do ...@@ -269,41 +274,15 @@ do
# If destination is a directory, append the input filename; won't work # If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored. # if double slashes aren't ignored.
if test -d "$dst"; then if test -d "$dst"; then
if test -n "$no_target_directory"; then if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2 echo "$0: $dst_arg: Is a directory" >&2
exit 1 exit 1
fi fi
dstdir=$dst dstdir=$dst
dst=$dstdir/`basename "$src"` dst=$dstdir/`basename "$src"`
dstdir_status=0 dstdir_status=0
else else
# Prefer dirname, but fall back on a substitute if dirname fails. dstdir=`dirname "$dst"`
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir" test -d "$dstdir"
dstdir_status=$? dstdir_status=$?
fi fi
...@@ -314,74 +293,81 @@ do ...@@ -314,74 +293,81 @@ do
if test $dstdir_status != 0; then if test $dstdir_status != 0; then
case $posix_mkdir in case $posix_mkdir in
'') '')
# Create intermediate dirs using mode 755 as modified by the umask. # Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28. # This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask` umask=`umask`
case $stripcmd.$umask in case $stripcmd.$umask in
# Optimize common cases. # Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;; *[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7]) *[0-7])
mkdir_umask=`expr $umask + 22 \ mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \ - $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2 - $umask % 10 % 4 + $umask % 2
`;; `;;
*) mkdir_umask=$umask,go-w;; *) mkdir_umask=$umask,go-w;;
esac esac
# With -d, create the new directory with the user-specified mode. # With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask. # Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then if test -n "$dir_arg"; then
mkdir_mode=-m$mode mkdir_mode=-m$mode
else else
mkdir_mode= mkdir_mode=
fi fi
posix_mkdir=false posix_mkdir=false
case $umask in case $umask in
*[123567][0-7][0-7]) *[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which # POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0. # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;; ;;
*) *)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ # $RANDOM is not portable (e.g. dash); use it when possible to
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 # lower collision chance
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
if (umask $mkdir_umask && trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then # As "mkdir -p" follows symlinks and we work in /tmp possibly; so
if test -z "$dir_arg" || { # create the $tmpdir first (and fail if unsuccessful) to make sure
# Check for POSIX incompatibilities with -m. # that nobody tries to guess the $tmpdir name.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or if (umask $mkdir_umask &&
# other-writable bit of parent directory when it shouldn't. $mkdirprog $mkdir_mode "$tmpdir" &&
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory. exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
ls_ld_tmpdir=`ls -ld "$tmpdir"` then
case $ls_ld_tmpdir in if test -z "$dir_arg" || {
d????-?r-*) different_mode=700;; # Check for POSIX incompatibilities with -m.
d????-?--*) different_mode=755;; # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
*) false;; # other-writable bit of parent directory when it shouldn't.
esac && # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
$mkdirprog -m$different_mode -p -- "$tmpdir" && { test_tmpdir="$tmpdir/a"
ls_ld_tmpdir_1=`ls -ld "$tmpdir"` ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" case $ls_ld_tmpdir in
} d????-?r-*) different_mode=700;;
} d????-?--*) different_mode=755;;
then posix_mkdir=: *) false;;
fi esac &&
rmdir "$tmpdir/d" "$tmpdir" $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
else ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
# Remove any dirs left behind by ancient mkdir implementations. test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null }
fi }
trap '' 0;; then posix_mkdir=:
esac;; fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac;;
esac esac
if if
$posix_mkdir && ( $posix_mkdir && (
umask $mkdir_umask && umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
) )
then : then :
else else
...@@ -391,53 +377,51 @@ do ...@@ -391,53 +377,51 @@ do
# directory the slow way, step by step, checking for races as we go. # directory the slow way, step by step, checking for races as we go.
case $dstdir in case $dstdir in
/*) prefix='/';; /*) prefix='/';;
[-=\(\)!]*) prefix='./';; [-=\(\)!]*) prefix='./';;
*) prefix='';; *) prefix='';;
esac esac
eval "$initialize_posix_glob"
oIFS=$IFS oIFS=$IFS
IFS=/ IFS=/
$posix_glob set -f set -f
set fnord $dstdir set fnord $dstdir
shift shift
$posix_glob set +f set +f
IFS=$oIFS IFS=$oIFS
prefixes= prefixes=
for d for d
do do
test X"$d" = X && continue test X"$d" = X && continue
prefix=$prefix$d prefix=$prefix$d
if test -d "$prefix"; then if test -d "$prefix"; then
prefixes= prefixes=
else else
if $posix_mkdir; then if $posix_mkdir; then
(umask=$mkdir_umask && (umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently. # Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1 test -d "$prefix" || exit 1
else else
case $prefix in case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;; *) qprefix=$prefix;;
esac esac
prefixes="$prefixes '$qprefix'" prefixes="$prefixes '$qprefix'"
fi fi
fi fi
prefix=$prefix/ prefix=$prefix/
done done
if test -n "$prefixes"; then if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently. # Don't fail if two instances are running concurrently.
(umask $mkdir_umask && (umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") || eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1 test -d "$dstdir" || exit 1
obsolete_mkdir_used=true obsolete_mkdir_used=true
fi fi
fi fi
fi fi
...@@ -472,15 +456,12 @@ do ...@@ -472,15 +456,12 @@ do
# If -C, don't bother to copy if it wouldn't change the file. # If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change && if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 && set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f && set +f &&
test "$old" = "$new" && test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then then
...@@ -493,24 +474,24 @@ do ...@@ -493,24 +474,24 @@ do
# to itself, or perhaps because mv is so ancient that it does not # to itself, or perhaps because mv is so ancient that it does not
# support -f. # support -f.
{ {
# Now remove or move aside any old file at destination location. # Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some # We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other # systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new # reasons. In this case, the final cleanup might fail but the new
# file should still install successfully. # file should still install successfully.
{ {
test ! -f "$dst" || test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null || $doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} || } ||
{ echo "$0: cannot unlink or rename $dst" >&2 { echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1 (exit 1); exit 1
} }
} && } &&
# Now rename the file to the real destination. # Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst" $doit $mvcmd "$dsttmp" "$dst"
} }
fi || exit 1 fi || exit 1
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
scriptversion=2013-10-28.13; # UTC scriptversion=2013-10-28.13; # UTC
# Copyright (C) 1996-2013 Free Software Foundation, Inc. # Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment