Mailinglist Archive: opensuse-commit (1903 mails)

< Previous Next >
commit libuev for openSUSE:Factory
Hello community,

here is the log from the commit of package libuev for openSUSE:Factory checked
in at 2019-04-12 09:15:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libuev (Old)
and /work/SRC/openSUSE:Factory/.libuev.new.27019 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libuev"

Fri Apr 12 09:15:01 2019 rev:5 rq:692243 version:2.3.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/libuev/libuev.changes 2018-10-08
17:50:55.802062840 +0200
+++ /work/SRC/openSUSE:Factory/.libuev.new.27019/libuev.changes 2019-04-12
09:15:04.753701618 +0200
@@ -1,0 +2,6 @@
+Mon Apr 8 08:28:23 UTC 2019 - mvetter@xxxxxxxx
+
+- Update to 2.3.0:
+ * Support for Linux eventfd, uev_event_*() see API.md for details
+
+-------------------------------------------------------------------

Old:
----
libuev-2.2.0.tar.gz

New:
----
libuev-2.3.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libuev.spec ++++++
--- /var/tmp/diff_new_pack.su8Znf/_old 2019-04-12 09:15:06.365702641 +0200
+++ /var/tmp/diff_new_pack.su8Znf/_new 2019-04-12 09:15:06.365702641 +0200
@@ -1,7 +1,7 @@
#
# spec file for package libuev
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018, Martin Hauke <mardnh@xxxxxx>
#
# All modifications and additions to the file contributed by third parties
@@ -19,7 +19,7 @@

%define sover 2
Name: libuev
-Version: 2.2.0
+Version: 2.3.0
Release: 0
Summary: Event loop library
License: MIT

++++++ libuev-2.2.0.tar.gz -> libuev-2.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/API.md new/libuev-2.3.0/API.md
--- old/libuev-2.2.0/API.md 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/API.md 2019-04-06 13:33:06.000000000 +0200
@@ -87,6 +87,11 @@
int uev_signal_set (uev_t *w, int signo); /* Change signal to
wait for */
int uev_signal_start(uev_t *w); /* Restart a stopped
signal watcher */
int uev_signal_stop (uev_t *w); /* Stop signal
watcher */
+
+/* Generic event watcher, post events for later processing, or from forked
child */
+int uev_event_init (uev_ctx_t *ctx, uev_t *w, uev_cb_t *cb, void *arg);
+int uev_event_post (uev_t *w);
+int uev_event_stop (uev_t *w);
```


@@ -309,16 +314,16 @@

int main(void)
{
- int fd;
- uev_t watcher;
uev_ctx_t ctx;
+ uev_t js;
+ int fd;

fd = open("/dev/input/js0", O_RDONLY, O_NONBLOCK);
if (fd < 0)
errx(errno, "Cannot find a joystick attached.");

uev_init(&ctx);
- uev_io_init(&ctx, &watcher, joystick_cb, NULL, fd, UEV_READ);
+ uev_io_init(&ctx, &js, joystick_cb, NULL, fd, UEV_READ);

puts("Starting, press Ctrl-C to exit.");

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/ChangeLog.md
new/libuev-2.3.0/ChangeLog.md
--- old/libuev-2.2.0/ChangeLog.md 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/ChangeLog.md 2019-04-06 13:33:06.000000000 +0200
@@ -4,6 +4,14 @@
All notable changes to the project are documented in this file.


+[v2.3.0][] - 2019-04-06
+-----------------------
+
+### Changes
+
+- Support for Linux eventfd, `uev_event_*()` see [API.md][] for details
+
+
[v2.2.0][] - 2018-10-04
-----------------------

@@ -384,7 +392,8 @@
Lua users mailing list.


-[UNRELEASED]: https://github.com/troglobit/libuev/compare/v2.2.0...HEAD
+[UNRELEASED]: https://github.com/troglobit/libuev/compare/v2.3.0...HEAD
+[v2.3.0]: https://github.com/troglobit/libuev/compare/v2.2.0...v2.3.0
[v2.2.0]: https://github.com/troglobit/libuev/compare/v2.1.3...v2.2.0
[v2.1.3]: https://github.com/troglobit/libuev/compare/v2.1.2...v2.1.3
[v2.1.2]: https://github.com/troglobit/libuev/compare/v2.1.1...v2.1.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/HACKING.md new/libuev-2.3.0/HACKING.md
--- old/libuev-2.2.0/HACKING.md 1970-01-01 01:00:00.000000000 +0100
+++ new/libuev-2.3.0/HACKING.md 2019-04-06 13:33:06.000000000 +0200
@@ -0,0 +1,106 @@
+Maintenance and Release Checklist
+=================================
+
+Maintenance
+-----------
+
+* Encourage contributors to write tests, in particular for new features
+* Run tests regularly, use Travis-CI to do this automatically
+* Leverage GitHub issues for milestone planning
+* Reference issues from GitHub pull requests to alert issue subscribers
+* Bump library ABI version just before release!
+
+
+Release Checklist
+-----------------
+
+* Update ChangeLog, follow http://keepachangelog.com/ loosely
+ - Inform users in a plain language of changes and bug fixes
+ - Do *not* copy-paste GIT commit logs!
+ - Order entries according to importance, most relevant first
+* Run unit tests: `make check`
+* Make at least one `-rcN` release and test it in an actual real project
+* **REMEMBER:** bump ABI version according to below rules
+* Tag
+* Push last commit(s) *and* tags to GitHub
+* Make release
+
+ make distclean
+ ./autogen.sh
+ ./configure
+ make release
+
+* Create new release in GitHub releases page
+* Copy and paste ChangeLog entry, check any stale links!
+* Upload release tarball and MD5 files
+
+
+Library Versioning
+------------------
+
+libuEv relies on GNU Libtool for building the library. For users of the
+library it is important to maintain a clear ABI versioning scheme. This
+is not the same as the libuEv version, but rather its "compatibility
+level".
+
+The libuEv ABI version is specified in `src/Makefile.am`:
+
+ libuev_la_LDFLAGS = -version-info 0:0:0
+ \ \ `-- age
+ \ `--- revision
+ `---- current
+
+It must be updated according to the [GNU Libtool recommendations][1]:
+
+1. Start with version information of `0:0:0` for each libtool library.
+2. Update the version information only immediately before a public
+ release of your software. More frequent updates are unnecessary, and
+ only guarantee that the current interface number gets larger faster.
+3. If the library *source code has changed at all* since the last update,
+ then increment revision (`c:r:a` becomes `c:r+1:a`).
+4. If any *interfaces have been added, removed, or changed* since the
+ last update, increment current, and set revision to 0.
+5. If any *interfaces have been added* since the last public release,
+ then increment age.
+6. If any *interfaces have been removed or changed* since the last
+ public release, then set age to 0.
+
+The libtool ABI versioning logic is very confusing but works if you just
+disable your brain and follow the rules, one by one.
+
+**Example #1:** a new function has been added, none of the existing ones
+have changed. The initial version is 1:0:0, we follow the rules above to
+the letter: increase revision, increase current and set revision to zero,
+and finally increase age. This, rather confusingly, gives us 2:0:1 which
+libtool then translates to `libuev.so.1.1.0`.
+
+**Example #2:** some existing functions are changed, they now return an
+`int` instead of `void`. The initial version is 0:0:0, and we follow the
+rules again: increment revision, increment current and set revision to
+zero, set age to zero. This gives us 1:0:0, which is then translated to
+ `libuev.so.1.0.0`.
+
+
+### Note
+
+Usually, non-developers have no interest in running development versions
+(releases are frequent enough), and developers are expected to know how
+to juggle versions. In such an ideal world, it is good enough to bump
+the library version just prior to a release, point 2.
+
+However, if releases are few and far between, distributors may start to
+use snapshots. When a distributor uses a snapshot, the distributor has
+to handle the library version manually. Things can get ugly when the
+distributor has released an intermediate version with a bumped library
+version, and when the official release is bumped to that version, the
+distributor will then have to bump the library version for the official
+release, and it can be confusing if someone reports bugs on versions
+that you didn't even know existed.
+
+The problem with bumping the version with every change is that if your
+interface is not finished, the version number might run away, and it
+looks pretty bad if a library is at version 262. It kind of tells the
+user that the library interface is volatile, which is not good for
+business.
+
+[1]:
https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/LICENSE new/libuev-2.3.0/LICENSE
--- old/libuev-2.2.0/LICENSE 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/LICENSE 2019-04-06 13:33:06.000000000 +0200
@@ -1,5 +1,5 @@
Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
-Copyright (c) 2013-2017 Joachim Nilsson <troglobit()gmail!com>
+Copyright (c) 2013-2019 Joachim Nilsson <troglobit()gmail!com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/README.md new/libuev-2.3.0/README.md
--- old/libuev-2.2.0/README.md 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/README.md 2019-04-06 13:33:06.000000000 +0200
@@ -1,5 +1,5 @@
-libuEv | Simple event loop for Linux
-====================================
+µEv | Simple event loop for Linux
+==================================
[![Travis Status][]][Travis] [![Coverity Status][]][Coverity Scan]


@@ -20,10 +20,10 @@
Introduction
------------

-[libuEv][] is a simple event loop in the style of the more established
-[libevent][1], [libev][2] and the venerable [Xt(3)][3] event loop. The
-*u* (micro) in the name refers to both the small feature set and the
-small size overhead impact of the library.
+[libuEv][] is a small event loop that wraps the Linux `epoll()` family
+of APIs. It is similar to the more established [libevent][], [libev][]
+and the venerable [Xt(3)][] event loop. The *µ* in the name refers to
+both its limited feature set and the size impact of the library.

Failure mode changes introduced in v2.0 may affect users of v1.x, See
the [ChangeLog][] for the full details.
@@ -34,34 +34,35 @@
Example
-------

-Notice below how watcher `UEV_ERROR` conditions must be handled by each
+Notice how watcher conditions like `UEV_ERROR` must be handled by each
callback. I/O watchers must also check for `UEV_HUP`. Both errors are
usually fatal, libuEv makes sure to stop each watcher before a callback
runs, leaving it up to the callback to take appropriate action.

```C
+/* Set up a timer watcher to call cb() every other second */
#include <stdio.h>
#include <uev/uev.h>

static void cb(uev_t *w, void *arg, int events)
{
- if (UEV_ERROR == events) {
- puts("Problem with timer, attempting to restart.");
- uev_timer_start(w);
- }
- puts("Every other second");
+ if (UEV_ERROR == events) {
+ puts("Problem with timer, attempting to restart.");
+ uev_timer_start(w);
+ }
+
+ puts("Every other second");
}

int main(void)
{
- uev_t timer;
- uev_ctx_t ctx;
+ uev_ctx_t ctx;
+ uev_t timer;

- uev_init(&ctx);
- /* Set up a timer watcher to call cb() every other second */
- uev_timer_init(&ctx, &timer, cb, NULL, 2 * 1000, 2 * 1000);
+ uev_init(&ctx);
+ uev_timer_init(&ctx, &timer, cb, NULL, 2 * 1000, 2 * 1000);

- return uev_run(&ctx, 0);
+ return uev_run(&ctx, 0);
}
```

@@ -82,36 +83,40 @@
sudo ldconfig
```

-The resulting .so file is ~14 kiB.
+The resulting .so library is ~23 kiB.
+
+To build from GIT sources; clone the repository and run the `autogen.sh`
+script. This requires GNU `automake`, `autoconf` amd `libtool` to be
+installed on your system. (If you build from a released tarball you do
+not need them.)


Origin & References
-------------------

-[libuEv][] originates from [LibUEvent][8] by [Flemming Madsen][], but
-with a rewritten and much cleaner API. It is now more similar to the
-famous [libev][2] by [Mark Lehmann][]. Another library inspiring this
-project is [picoev][9] by [Oku Kazuho][].
-
-[libuEv][] is developed and maintained by [Joachim Nilsson][]. It is
-built for and developed on GNU/Linux systems, patches to support *BSD
-and its [kqueue][] interface are most welcome.
+[libuEv][] is developed and maintained by [Joachim Nilsson][] on GitHub.
+It is primarily built for and developed on GNU/Linux systems, patches to
+support the BSD [kqueue][] interface are most welcome.
+
+Originally based on [LibUEvent][] by [Flemming Madsen][], uEv has since
+evolved to support all of the Linux `epoll()` family APIs. It is now
+more similar to the excellent [libev][] by [Mark Lehmann][], with some
+inspiration also from [picoev][] by [Oku Kazuho][].


-[1]: http://libevent.org
-[2]: http://software.schmorp.de/pkg/libev.html
-[3]: http://unix.com/man-page/All/3x/XtDispatchEvent
-[8]: http://code.google.com/p/libuevent/
-[9]: https://github.com/kazuho/picoev
[ChangeLog]: https://github.com/troglobit/libuev/blob/master/ChangeLog.md
[Travis]: https://travis-ci.org/troglobit/libuev
[Travis Status]: https://travis-ci.org/troglobit/libuev.png?branch=master
[Coverity Scan]: https://scan.coverity.com/projects/3846
[Coverity Status]: https://scan.coverity.com/projects/3846/badge.svg
+[libevent]: https://libevent.org
+[Xt(3)]: https://unix.com/man-page/All/3x/XtDispatchEvent
+[LibUEvent]: https://code.google.com/p/libuevent/
+[picoev]: https://github.com/kazuho/picoev
+[libev]: http://software.schmorp.de/pkg/libev.html
[LibuEv]: https://github.com/troglobit/libuev
[kqueue]: https://github.com/mheily/libkqueue
[Oku Kazuho]: https://github.com/kazuho
[Mark Lehmann]: http://software.schmorp.de
[Joachim Nilsson]: http://troglobit.com
[Flemming Madsen]: http://www.madsensoft.dk
-[Dave Zarzycki, Apple]: http://www.youtube.com/watch?v=cD_s6Fjdri8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/configure.ac
new/libuev-2.3.0/configure.ac
--- old/libuev-2.2.0/configure.ac 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/configure.ac 2019-04-06 13:33:06.000000000 +0200
@@ -1,4 +1,4 @@
-AC_INIT(libuev, 2.2.0, https://github.com/troglobit/libuev/issues)
+AC_INIT(libuev, 2.3.0, https://github.com/troglobit/libuev/issues)
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
AM_SILENT_RULES([yes])

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/debian/README.debian
new/libuev-2.3.0/debian/README.debian
--- old/libuev-2.2.0/debian/README.debian 2018-10-04 21:06:51.000000000
+0200
+++ new/libuev-2.3.0/debian/README.debian 2019-04-06 13:33:06.000000000
+0200
@@ -8,7 +8,7 @@

Recommended reading is the upstream README and API docs.

- less /usr/share/doc/libuev-dev/README.md
- zless /usr/share/doc/libuev-dev/API.md.gz
+ less /usr/share/doc/libuev-dev/README.md
+ less /usr/share/doc/libuev-dev/API.md

- -- Joachim Nilsson <troglobit@xxxxxxxxx> Thu, 21 Sep 18:10, 2017
+ -- Joachim Nilsson <troglobit@xxxxxxxxx> Sat, 6 Apr 13:18, 2019
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/debian/changelog
new/libuev-2.3.0/debian/changelog
--- old/libuev-2.2.0/debian/changelog 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/debian/changelog 2019-04-06 13:33:06.000000000 +0200
@@ -1,3 +1,9 @@
+libuev (2.3.0) unstable; urgency=medium
+
+ * Support for Linux eventfd, uev_event_*(), see API.md for details.
+
+ -- Joachim Nilsson <troglobit@xxxxxxxxx> Thu, 06 Apr 2019 13:09:31 +0200
+
libuev (2.2.0) unstable; urgency=medium

* Replaced BSD queue.h with own linked list implementation. This means
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/debian/compat
new/libuev-2.3.0/debian/compat
--- old/libuev-2.2.0/debian/compat 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/debian/compat 2019-04-06 13:33:06.000000000 +0200
@@ -1 +1 @@
-9
+10
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/debian/control
new/libuev-2.3.0/debian/control
--- old/libuev-2.2.0/debian/control 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/debian/control 2019-04-06 13:33:06.000000000 +0200
@@ -1,12 +1,12 @@
Source: libuev
+Section: libs
Priority: optional
Maintainer: Joachim Nilsson <troglobit@xxxxxxxxx>
Build-Depends: dpkg-dev (>= 1.14.9), debhelper (>= 9), dh-autoreconf
-Standards-Version: 3.9.6
-Section: libs
+Standards-Version: 4.3.0
Homepage: https://github.com/troglobit/libuev/
-Vcs-Git: https://github.com/troglobit/libuev.git
Vcs-Browser: https://github.com/troglobit/libuev/
+Vcs-Git: https://github.com/troglobit/libuev.git

Package: libuev-dev
Priority: extra
@@ -14,26 +14,24 @@
Architecture: any
Depends: ${misc:Depends}, libuev (= ${binary:Version})
Description: static library, header files, and docs for libuev
- Static library, header files, and documentation for libuev.
+ Static library, header files, and documentation for libuEv
.
- libuEv is a simple event loop in the style of the more established
- libevent, libev and the venerable Xt(3) event loop. The u (micro) in the
- name refers to both the small feature set and the small size overhead
- impact of the library.
+ libuEv is a small event loop that wraps the Linux epoll() family of APIs.
+ It is similar to the more established libevent, libev and the venerable
+ Xt(3) event loop. The u (micro) in the name refers to both its limited
+ feature set and the small size impact of the library.
.
- Experienced developers may appreciate that libuEv is built on top of
- modern Linux APIs: epoll, timerfd and signalfd. Note however, a certain
- amount of care is needed when dealing with APIs that employ signalfd.
+ Experienced developers may appreciate libuEv is built on top of modern
+ Linux APIs like epoll, eventfd, timerf, and signalfd.

Package: libuev
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
-Description: Lightweight event loop library
- libuEv is a simple event loop in the style of the more established
- libevent, libev and the venerable Xt(3) event loop. The u (micro) in the
- name refers to both the small feature set and the small size overhead
- impact of the library.
+Description: Lightweight event loop library for Linux
+ libuEv is a small event loop that wraps the Linux epoll() family of APIs.
+ It is similar to the more established libevent, libev and the venerable
+ Xt(3) event loop. The u (micro) in the name refers to both its limited
+ feature set and the small size impact of the library.
.
- Experienced developers may appreciate that libuEv is built on top of
- modern Linux APIs: epoll, timerfd and signalfd. Note however, a certain
- amount of care is needed when dealing with APIs that employ signalfd.
+ Experienced developers may appreciate libuEv is built on top of modern
+ Linux APIs like epoll, eventfd, timerfd, and signalfd.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/debian/copyright
new/libuev-2.3.0/debian/copyright
--- old/libuev-2.2.0/debian/copyright 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/debian/copyright 2019-04-06 13:33:06.000000000 +0200
@@ -1,26 +1,35 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: libuEv
+Upstream-Contact: troglobit@xxxxxxxxx
Source: https.//github.com/troglobit/libuev/
+Comment: Debianized by upstream on Mon, Nov 28 2016 23:23:17 +0100

Files: *
-Copyright: 2013-2017 Joachim Nilsson <troglobit@xxxxxxxxx>
+Copyright: 2012 Flemming Madsen <flemming.madsen@xxxxxxxxxxxxx>
+ 2013-2019 Joachim Nilsson <troglobit@xxxxxxxxx>
License: MIT
-Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
-Copyright (c) 2013-2017 Joachim Nilsson <troglobit()gmail!com>

-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+Files: debian/*
+Copyright: 2016-2019 Joachim Nilsson <troglobit@xxxxxxxxx>

-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+License: MIT
+ Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
+ Copyright (c) 2013-2019 Joachim Nilsson <troglobit()gmail!com>
+ .
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/debian/libuev.dirs
new/libuev-2.3.0/debian/libuev.dirs
--- old/libuev-2.2.0/debian/libuev.dirs 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/debian/libuev.dirs 2019-04-06 13:33:06.000000000 +0200
@@ -1 +1,2 @@
usr/lib
+usr/share
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/debian/rules
new/libuev-2.3.0/debian/rules
--- old/libuev-2.2.0/debian/rules 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/debian/rules 2019-04-06 13:33:06.000000000 +0200
@@ -1,10 +1,17 @@
#!/usr/bin/make -f
-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
dh $@ --with autoreconf

override_dh_compress:
dh_compress -A -X.md
+
+override_dh_installchangelogs:
+ dh_installchangelogs ChangeLog.md
+
+override_dh_auto_install:
+ dh_auto_install
+ find debian -name LICENSE -delete
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/examples/joystick.c
new/libuev-2.3.0/examples/joystick.c
--- old/libuev-2.2.0/examples/joystick.c 2018-10-04 21:06:51.000000000
+0200
+++ new/libuev-2.3.0/examples/joystick.c 2019-04-06 13:33:06.000000000
+0200
@@ -1,6 +1,6 @@
/* Simple example of how to use libuEv with Linux joystick API
*
- * Copyright (c) 2014-2017 Joachim Nilsson <troglobit()gmail!com>
+ * Copyright (c) 2014-2019 Joachim Nilsson <troglobit()gmail!com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
deal
@@ -74,16 +74,16 @@

int main(void)
{
- int fd;
- uev_t js1_watcher;
uev_ctx_t ctx;
+ uev_t js1;
+ int fd;

fd = open("/dev/input/js0", O_RDONLY, O_NONBLOCK);
if (fd < 0)
errx(errno, "Cannot find a joystick attached.");

uev_init(&ctx);
- uev_io_init(&ctx, &js1_watcher, joystick_cb, NULL, fd, UEV_READ);
+ uev_io_init(&ctx, &js1, joystick_cb, NULL, fd, UEV_READ);

puts("Starting, press Ctrl-C to exit.");

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/examples/redirect.c
new/libuev-2.3.0/examples/redirect.c
--- old/libuev-2.2.0/examples/redirect.c 2018-10-04 21:06:51.000000000
+0200
+++ new/libuev-2.3.0/examples/redirect.c 2019-04-06 13:33:06.000000000
+0200
@@ -47,9 +47,9 @@

int main(int argc, char **argv)
{
- int ret;
- uev_t watcher;
uev_ctx_t ctx;
+ uev_t watcher;
+ int ret;

uev_init(&ctx);

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/src/Makefile.am
new/libuev-2.3.0/src/Makefile.am
--- old/libuev-2.2.0/src/Makefile.am 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/src/Makefile.am 2019-04-06 13:33:06.000000000 +0200
@@ -1,8 +1,8 @@
lib_LTLIBRARIES = libuev.la
-libuev_la_SOURCES = uev.c uev.h private.h io.c timer.c signal.c cron.c
+libuev_la_SOURCES = uev.c uev.h private.h io.c timer.c signal.c cron.c
event.c
libuev_la_CPPFLAGS = -D_GNU_SOURCE -D_TIME_BITS=64
libuev_la_CFLAGS = -W -Wall -Wextra -std=gnu11
-libuev_la_LDFLAGS = $(AM_LDFLAGS) -version-info 3:0:1
+libuev_la_LDFLAGS = $(AM_LDFLAGS) -version-info 4:0:2

noinst_PROGRAMS = bench
bench_CPPFLAGS = -D_GNU_SOURCE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/src/cron.c new/libuev-2.3.0/src/cron.c
--- old/libuev-2.2.0/src/cron.c 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/src/cron.c 2019-04-06 13:33:06.000000000 +0200
@@ -1,7 +1,7 @@
/* libuEv - Micro event loop library
*
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
- * Copyright (c) 2013-2017 Joachim Nilsson <troglobit()gmail!com>
+ * Copyright (c) 2013-2019 Joachim Nilsson <troglobit()gmail!com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
deal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/src/event.c new/libuev-2.3.0/src/event.c
--- old/libuev-2.2.0/src/event.c 1970-01-01 01:00:00.000000000 +0100
+++ new/libuev-2.3.0/src/event.c 2019-04-06 13:33:06.000000000 +0200
@@ -0,0 +1,106 @@
+/* libuEv - Micro event loop library
+ *
+ * Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
+ * Copyright (c) 2013-2019 Joachim Nilsson <troglobit()gmail!com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <errno.h>
+#include <sys/eventfd.h>
+#include <unistd.h> /* close(), read() */
+
+#include "uev.h"
+
+
+/**
+ * Create a generic event watcher
+ * @param ctx A valid libuEv context
+ * @param w Pointer to an uev_t watcher
+ * @param cb Callback when an event is posted
+ * @param arg Optional callback argument
+ *
+ * @return POSIX OK(0) or non-zero with @param errno set on error.
+ */
+int uev_event_init(uev_ctx_t *ctx, uev_t *w, uev_cb_t *cb, void *arg)
+{
+ int fd;
+
+ if (!w || !ctx) {
+ errno = EINVAL;
+ return -1;
+ }
+ w->fd = -1;
+
+ fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
+ if (fd < 0)
+ return -1;
+
+ return _uev_watcher_init(ctx, w, UEV_EVENT_TYPE, cb, arg, fd, UEV_READ)
+ || _uev_watcher_start(w);
+}
+
+/**
+ * Post a generic event
+ * @param w Watcher to post to
+ *
+ * @return POSIX OK(0) or non-zero with @param errno set on error.
+ */
+int uev_event_post(uev_t *w)
+{
+ uint64_t val = 1;
+
+ if (!w || -1 == w->fd) {
+ errno = EINVAL;
+ return -1;
+ }
+
+
+ if (write(w->fd, &val, sizeof(val)) != sizeof(val))
+ return -1;
+
+ return 0;
+}
+
+/**
+ * Stop a generic event watcher
+ * @param w Watcher to stop
+ *
+ * @return POSIX OK(0) or non-zero with @param errno set on error.
+ */
+int uev_event_stop(uev_t *w)
+{
+ if (!_uev_watcher_active(w))
+ return 0;
+
+ if (_uev_watcher_stop(w))
+ return -1;
+
+ close(w->fd);
+ w->fd = -1;
+
+ return 0;
+}
+
+/**
+ * Local Variables:
+ * indent-tabs-mode: t
+ * c-file-style: "linux"
+ * End:
+ */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/src/io.c new/libuev-2.3.0/src/io.c
--- old/libuev-2.2.0/src/io.c 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/src/io.c 2019-04-06 13:33:06.000000000 +0200
@@ -1,7 +1,7 @@
/* libuEv - Micro event loop library
*
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
- * Copyright (c) 2013-2017 Joachim Nilsson <troglobit()gmail!com>
+ * Copyright (c) 2013-2019 Joachim Nilsson <troglobit()gmail!com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
deal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/src/private.h
new/libuev-2.3.0/src/private.h
--- old/libuev-2.2.0/src/private.h 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/src/private.h 2019-04-06 13:33:06.000000000 +0200
@@ -1,7 +1,7 @@
/* libuEv - Private methods and data types, do not use directly!
*
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
- * Copyright (c) 2013-2015 Joachim Nilsson <troglobit()gmail!com>
+ * Copyright (c) 2013-2019 Joachim Nilsson <troglobit()gmail!com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
deal
@@ -66,6 +66,7 @@
UEV_SIGNAL_TYPE,
UEV_TIMER_TYPE,
UEV_CRON_TYPE,
+ UEV_EVENT_TYPE,
} uev_type_t;

/* Event mask, used internally only. */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/src/signal.c
new/libuev-2.3.0/src/signal.c
--- old/libuev-2.2.0/src/signal.c 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/src/signal.c 2019-04-06 13:33:06.000000000 +0200
@@ -1,7 +1,7 @@
/* libuEv - Micro event loop library
*
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
- * Copyright (c) 2013-2017 Joachim Nilsson <troglobit()gmail!com>
+ * Copyright (c) 2013-2019 Joachim Nilsson <troglobit()gmail!com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
deal
@@ -34,7 +34,7 @@
* Create a signal watcher
* @param ctx A valid libuEv context
* @param w Pointer to an uev_t watcher
- * @param cb Timer callback
+ * @param cb Signal callback
* @param arg Optional callback argument
* @param signo Signal to watch for
*
@@ -42,8 +42,8 @@
*/
int uev_signal_init(uev_ctx_t *ctx, uev_t *w, uev_cb_t *cb, void *arg, int
signo)
{
- int fd;
sigset_t mask;
+ int fd;

if (!w || !ctx) {
errno = EINVAL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/src/timer.c new/libuev-2.3.0/src/timer.c
--- old/libuev-2.2.0/src/timer.c 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/src/timer.c 2019-04-06 13:33:06.000000000 +0200
@@ -1,7 +1,7 @@
/* libuEv - Micro event loop library
*
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
- * Copyright (c) 2013-2017 Joachim Nilsson <troglobit()gmail!com>
+ * Copyright (c) 2013-2019 Joachim Nilsson <troglobit()gmail!com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
deal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/src/uev.c new/libuev-2.3.0/src/uev.c
--- old/libuev-2.2.0/src/uev.c 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/src/uev.c 2019-04-06 13:33:06.000000000 +0200
@@ -1,7 +1,7 @@
/* libuEv - Micro event loop library
*
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
- * Copyright (c) 2013-2017 Joachim Nilsson <troglobit()gmail!com>
+ * Copyright (c) 2013-2019 Joachim Nilsson <troglobit()gmail!com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
deal
@@ -245,17 +245,21 @@
continue;

switch (w->type) {
- case UEV_CRON_TYPE:
- case UEV_TIMER_TYPE:
- uev_timer_stop(w);
+ case UEV_IO_TYPE:
+ uev_io_stop(w);
break;

case UEV_SIGNAL_TYPE:
uev_signal_stop(w);
break;

- case UEV_IO_TYPE:
- uev_io_stop(w);
+ case UEV_TIMER_TYPE:
+ case UEV_CRON_TYPE:
+ uev_timer_stop(w);
+ break;
+
+ case UEV_EVENT_TYPE:
+ uev_event_stop(w);
break;
}
}
@@ -285,8 +289,8 @@
*/
int uev_run(uev_ctx_t *ctx, int flags)
{
- int timeout = -1;
uev_t *w;
+ int timeout = -1;

if (!ctx || ctx->fd < 0) {
errno = EINVAL;
@@ -308,8 +312,8 @@
}

while (ctx->running && ctx->watchers) {
- int i, nfds, rerun = 0;
struct epoll_event ee[UEV_MAX_EVENTS];
+ int i, nfds, rerun = 0;

/* Handle special case: `application < file.txt` */
if (ctx->workaround) {
@@ -345,9 +349,9 @@
}

for (i = 0; ctx->running && i < nfds; i++) {
- uint64_t exp;
- uint32_t events;
struct signalfd_siginfo fdsi;
+ uint32_t events;
+ uint64_t exp;
ssize_t sz = sizeof(fdsi);

w = (uev_t *)ee[i].data.ptr;
@@ -396,6 +400,11 @@
if (!w->u.c.when)
uev_timer_stop(w);
break;
+
+ case UEV_EVENT_TYPE:
+ if (read(w->fd, &exp, sizeof(exp)) !=
sizeof(exp))
+ events = UEV_HUP;
+ break;
}

/*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/src/uev.h new/libuev-2.3.0/src/uev.h
--- old/libuev-2.2.0/src/uev.h 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/src/uev.h 2019-04-06 13:33:06.000000000 +0200
@@ -1,7 +1,7 @@
/* libuEv - Micro event loop library
*
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
- * Copyright (c) 2013-2015 Joachim Nilsson <troglobit()gmail!com>
+ * Copyright (c) 2013-2019 Joachim Nilsson <troglobit()gmail!com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
deal
@@ -47,9 +47,10 @@

/* Macros */
#define uev_io_active(w) _uev_watcher_active(w)
+#define uev_signal_active(w) _uev_watcher_active(w)
#define uev_timer_active(w) _uev_watcher_active(w)
#define uev_cron_active(w) _uev_watcher_active(w)
-#define uev_signal_active(w) _uev_watcher_active(w)
+#define uev_event_active(w) _uev_watcher_active(w)

/* Event watcher */
typedef struct uev {
@@ -100,6 +101,10 @@
int uev_signal_start (uev_t *w);
int uev_signal_stop (uev_t *w);

+int uev_event_init (uev_ctx_t *ctx, uev_t *w, uev_cb_t *cb, void *arg);
+int uev_event_post (uev_t *w);
+int uev_event_stop (uev_t *w);
+
#endif /* LIBUEV_UEV_H_ */

/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/tests/.gitignore
new/libuev-2.3.0/tests/.gitignore
--- old/libuev-2.2.0/tests/.gitignore 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/tests/.gitignore 2019-04-06 13:33:06.000000000 +0200
@@ -6,3 +6,4 @@
cronrun
signal
timer
+event
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/tests/Makefile.am
new/libuev-2.3.0/tests/Makefile.am
--- old/libuev-2.2.0/tests/Makefile.am 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/tests/Makefile.am 2019-04-06 13:33:06.000000000 +0200
@@ -8,6 +8,7 @@
TESTS += cronrun
TESTS += signal
TESTS += timer
+TESTS += event

check_PROGRAMS = $(TESTS)

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/tests/active.c
new/libuev-2.3.0/tests/active.c
--- old/libuev-2.2.0/tests/active.c 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/tests/active.c 2019-04-06 13:33:06.000000000 +0200
@@ -38,8 +38,8 @@

int main(void)
{
- uev_ctx_t ctx;
struct timeval tomorrow;
+ uev_ctx_t ctx;

gettimeofday(&tomorrow, NULL);
tomorrow.tv_sec += 24 * 60 * 60;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/tests/complete.c
new/libuev-2.3.0/tests/complete.c
--- old/libuev-2.2.0/tests/complete.c 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/tests/complete.c 2019-04-06 13:33:06.000000000 +0200
@@ -1,7 +1,7 @@
/* Test libuEv event library
*
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
- * Copyright (c) 2013-2015 Joachim Nilsson <troglobit()gmail!com>
+ * Copyright (c) 2013-2019 Joachim Nilsson <troglobit()gmail!com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
deal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/tests/cronrun.c
new/libuev-2.3.0/tests/cronrun.c
--- old/libuev-2.2.0/tests/cronrun.c 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/tests/cronrun.c 2019-04-06 13:33:06.000000000 +0200
@@ -1,6 +1,6 @@
/* Test cron API in libuEv event library
*
- * Copyright (c) 2016 Joachim Nilsson <troglobit()gmail!com>
+ * Copyright (c) 2016-2019 Joachim Nilsson <troglobit()gmail!com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
deal
@@ -33,8 +33,8 @@

static void cron_job(uev_t *w, void *arg, int events)
{
- static int laps = 3;
struct timeval now;
+ static int laps = 3;

if (UEV_ERROR == events)
fprintf(stderr, "cron watcher failed, ignoring ...\n");
@@ -54,10 +54,10 @@

int main(void)
{
- int rc;
- uev_t cron_watcher;
uev_ctx_t ctx;
time_t when, interval;
+ uev_t cron;
+ int rc;

uev_init(&ctx);

@@ -68,7 +68,7 @@
printf("Expected cron %s", ctime(&when));

interval = INTERVAL;
- uev_cron_init(&ctx, &cron_watcher, cron_job, NULL, when, interval);
+ uev_cron_init(&ctx, &cron, cron_job, NULL, when, interval);

rc = uev_run(&ctx, 0);
fail_unless(result == 0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/tests/event.c
new/libuev-2.3.0/tests/event.c
--- old/libuev-2.2.0/tests/event.c 1970-01-01 01:00:00.000000000 +0100
+++ new/libuev-2.3.0/tests/event.c 2019-04-06 13:33:06.000000000 +0200
@@ -0,0 +1,78 @@
+/* Verifies eventfd support
+ *
+ * Copyright (c) 2018-2019 Joachim Nilsson <troglobit@xxxxxxxxx>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "check.h"
+#include <err.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+#define LAPS 10
+pid_t pid;
+
+static void cb(uev_t *w, void *arg, int events)
+{
+ static int num = LAPS;
+
+ num--;
+// printf("Got event %d ...\n", LAPS - num);
+ if (num == 0) {
+ waitpid(pid, NULL, 0);
+ uev_exit(w->ctx);
+ }
+}
+
+int main(void)
+{
+ uev_ctx_t ctx;
+ uev_t ev;
+ int i;
+
+ /* Initialize libuEv */
+ uev_init(&ctx);
+
+ /* Setup callbacks */
+ uev_event_init(&ctx, &ev, cb, NULL);
+
+ pid = fork();
+ if (-1 == pid)
+ err(1, "fork");
+
+ /* Start event loop */
+ if (pid > 0)
+ return uev_run(&ctx, 0);
+
+ for (i = 0; i < LAPS; i++) {
+ uev_event_post(&ev);
+ usleep(10000);
+ }
+
+ return 0;
+}
+
+/**
+ * Local Variables:
+ * indent-tabs-mode: t
+ * c-file-style: "linux"
+ * End:
+ */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/tests/signal.c
new/libuev-2.3.0/tests/signal.c
--- old/libuev-2.2.0/tests/signal.c 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/tests/signal.c 2019-04-06 13:33:06.000000000 +0200
@@ -1,6 +1,6 @@
/* Multiple signals, segfault and fork() to test sub-processes.
*
- * Copyright (c) 2015 Joachim Nilsson <troglobit@xxxxxxxxx>
+ * Copyright (c) 2015-2019 Joachim Nilsson <troglobit@xxxxxxxxx>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
deal
@@ -81,8 +81,8 @@

static void work_cb(uev_t *w, void *arg, int events)
{
- int status = 0;
- pid_t pid;
+ pid_t pid;
+ int status = 0;

pid = fork();
if (-1 == pid)
@@ -113,8 +113,8 @@

int main(void)
{
- uev_t sigsegv_watcher, sigchld_watcher, timeout_watcher,
deadline_watcher;
uev_ctx_t ctx;
+ uev_t sigsegv_watcher, sigchld_watcher, timeout_watcher,
deadline_watcher;

/* Initialize libuEv */
uev_init(&ctx);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libuev-2.2.0/tests/timer.c
new/libuev-2.3.0/tests/timer.c
--- old/libuev-2.2.0/tests/timer.c 2018-10-04 21:06:51.000000000 +0200
+++ new/libuev-2.3.0/tests/timer.c 2019-04-06 13:33:06.000000000 +0200
@@ -23,9 +23,9 @@

int main(void)
{
- int rc;
- uev_t w;
uev_ctx_t ctx;
+ uev_t w;
+ int rc;

uev_init(&ctx);
uev_timer_init(&ctx, &w, cb, NULL, TIMEOUT * 1000, 0);


< Previous Next >
This Thread
  • No further messages