18 Commits
Author SHA1 Message Date
Joachim Wiberg c964bbe8fb .github: bump actions
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-04-28 08:35:10 +02:00
Joachim Wiberg faf7667012 Create SECURITY.md policy 2025-04-28 07:56:01 +02:00
Joachim Wiberg 332f28e5e1 .github: drop 'needs:' and set release variables
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-04 17:23:17 +01:00
Joachim Wiberg d3c021af42 Update changelog and bump version for v2.4.1 release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-04 17:16:57 +01:00
Joachim Wiberg 0f59096154 Update copyright years
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-04 17:16:49 +01:00
Joachim Wiberg d67290c073 .github: update and drop dep install, not needed
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-04 17:12:54 +01:00
Joachim Wiberg c23100c3f0 .github: bump action versions
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-04 17:05:32 +01:00
Joachim Wiberg ff2396b973 Mention new Linux APIs we use
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-28 23:40:30 +01:00
Joachim Wiberg 70ef23b9e3 Open v2.4.1 release cycle
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-17 15:14:35 +01:00
Joachim Wiberg 568fe6a9e1 Update changelog for upcoming v2.4.1 release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-17 15:14:01 +01:00
Joachim Wiberg ae048605db .github: bump actions to latest supported Node.JS
Prepare for next release by importing necessary changes to release.yml
from SMCroute.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-17 15:10:55 +01:00
Joachim Wiberg 2d9f1c9ce6 Fix #27: possible buffer overrun in uev_run()
If uev_init1() is called with maxevents > 10 the call to epoll_wait()
might cause buffer overflow.  Reported by Steve Palmer.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-17 15:02:21 +01:00
Joachim Wiberg f9c72a01c8 Minor, coding style
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-17 15:02:12 +01:00
Joachim Wiberg 270e270591 test: fix signed vs unsigned comparison
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-17 15:01:25 +01:00
Joachim Wiberg 3c3b37c9aa debian: update library ABI version in .symbols file
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-11-28 14:50:19 +01:00
Joachim Wiberg 0c92a564d8 debian: drop libtool dep and add doxygen
Apparently libtool is an implicit dependency and does not have to be
listed explicitly.

Add doxygen since we now have full doxygen docs to build.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-11-28 14:47:37 +01:00
Joachim Wiberg 53eadaa1c9 debian: fix copy-paste from libite in .symbols file
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-11-28 14:47:37 +01:00
Joachim Wiberg 9591ac7efb debian: Step library name to match SONAME
This patch fixes the lintian warning package-name-doesnt-match-sonames,
which is a reminder to step the library version to match the soname.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-10-03 09:03:44 +02:00
26 changed files with 105 additions and 78 deletions

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
# Security Policy
## Supported Versions
libuEv is a small project, as such we have no possibility to support older versions.
The only supported version is the latest released on GitHub:
<https://github.com/troglobit/libuev/releases>
## Reporting a Vulnerability
Contact the project's main author and owner to report and discuss vulnerabilities.
+3 -3
View File
@@ -28,7 +28,7 @@ jobs:
run: | run: |
sudo apt-get -y update sudo apt-get -y update
sudo apt-get -y install tree doxygen sudo apt-get -y install tree doxygen
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- name: Configure - name: Configure
run: | run: |
./autogen.sh ./autogen.sh
@@ -44,7 +44,7 @@ jobs:
run: | run: |
make check || (cat test/test-suite.log; false) make check || (cat test/test-suite.log; false)
- name: Upload Test Results - name: Upload Test Results
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v4
with: with:
name: libuev-test-${{ matrix.compiler }} name: libuev-test-${{ matrix.compiler }}
path: test/* path: test/*
@@ -53,7 +53,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: debian:stable container: debian:stable
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- name: Installing dependencies - name: Installing dependencies
run: | run: |
apt-get update apt-get update
+4 -10
View File
@@ -15,7 +15,7 @@ jobs:
coverity: coverity:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- name: Fetch latest Coverity Scan MD5 - name: Fetch latest Coverity Scan MD5
id: var id: var
env: env:
@@ -24,10 +24,8 @@ jobs:
wget -q https://scan.coverity.com/download/cxx/linux64 \ wget -q https://scan.coverity.com/download/cxx/linux64 \
--post-data "token=$TOKEN&project=${COVERITY_PROJ}&md5=1" \ --post-data "token=$TOKEN&project=${COVERITY_PROJ}&md5=1" \
-O coverity-latest.tar.gz.md5 -O coverity-latest.tar.gz.md5
export MD5=$(cat coverity-latest.tar.gz.md5) echo "md5=$(cat coverity-latest.tar.gz.md5)" | tee -a $GITHUB_OUTPUT
echo "Got MD5 $MD5" - uses: actions/cache@v4
echo ::set-output name=md5::${MD5}
- uses: actions/cache@v2
id: cache id: cache
with: with:
path: coverity-latest.tar.gz path: coverity-latest.tar.gz
@@ -50,10 +48,6 @@ jobs:
fi fi
mkdir coverity mkdir coverity
tar xzf coverity-latest.tar.gz --strip 1 -C coverity tar xzf coverity-latest.tar.gz --strip 1 -C coverity
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install pkg-config libsystemd-dev libcap-dev
- name: Configure - name: Configure
run: | run: |
./autogen.sh ./autogen.sh
@@ -76,7 +70,7 @@ jobs:
--form description="${PROJECT_NAME} $(git rev-parse HEAD)" \ --form description="${PROJECT_NAME} $(git rev-parse HEAD)" \
https://scan.coverity.com/builds?project=${COVERITY_PROJ} https://scan.coverity.com/builds?project=${COVERITY_PROJ}
- name: Upload build.log - name: Upload build.log
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v4
with: with:
name: coverity-build.log name: coverity-build.log
path: cov-int/build-log.txt path: cov-int/build-log.txt
+29 -34
View File
@@ -7,42 +7,32 @@ on:
jobs: jobs:
release: release:
name: Create GitHub release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_id: ${{ steps.create_release.outputs.id }}
steps:
- uses: actions/checkout@v2
- name: Extract ChangeLog entry ...
# Hack to extract latest entry for body_path below
run: |
awk '/-----*/{if (x == 1) exit; x=1;next}x' ChangeLog.md \
|head -n -1 > release.md
cat release.md
- name: Create release ...
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: libuEv ${{ github.ref }}
body_path: release.md
draft: false
prerelease: false
tarball:
name: Build and upload release tarball name: Build and upload release tarball
needs: release
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
MAKEFLAGS: -j3
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- name: Installing dependencies ... - name: Installing dependencies ...
run: | run: |
sudo apt-get -y update sudo apt-get -y update
sudo apt-get -y install tree doxygen sudo apt-get -y install tree doxygen
- name: Setting release variables ...
id: build
run: |
ver=${GITHUB_REF#refs/tags/}
echo "ver=${ver}" >> $GITHUB_OUTPUT
if echo $ver | grep -qE '^[0-9]+\.[0-9]+(\.[0-9]+)?(-alpha|-beta|-rc)[0-9]*$'; then
echo "pre=true" >> $GITHUB_OUTPUT
else
echo "pre=false" >> $GITHUB_OUTPUT
fi
if echo $ver | grep -qE '^[0-9.]+\.[0-9.]+(\.[0-9]+)?$'; then
echo "latest=true" >> $GITHUB_OUTPUT
else
echo "latest=false" >> $GITHUB_OUTPUT
fi
- name: Creating Makefiles ... - name: Creating Makefiles ...
run: | run: |
./autogen.sh ./autogen.sh
@@ -53,10 +43,15 @@ jobs:
ls -lF ../ ls -lF ../
mkdir -p artifacts/ mkdir -p artifacts/
mv ../*.tar.* artifacts/ mv ../*.tar.* artifacts/
- name: Upload release artifacts ... - name: Extract ChangeLog entry ...
uses: skx/github-action-publish-binaries@release-0.15 run: |
env: awk '/-----*/{if (x == 1) exit; x=1;next}x' ChangeLog.md \
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |head -n -1 > release.md
cat release.md
- uses: ncipollo/release-action@v1
with: with:
releaseId: ${{ needs.release.outputs.release_id }} name: libuEv ${{ github.ref_name }}
args: artifacts/* prerelease: ${{ steps.build.outputs.pre }}
makeLatest: ${{ steps.build.outputs.latest }}
bodyFile: "release.md"
artifacts: "artifacts/*"
+11
View File
@@ -4,6 +4,16 @@ Change Log
All notable changes to the project are documented in this file. All notable changes to the project are documented in this file.
[v2.4.1][] - 2024-01-04
-----------------------
### Changes
- Update README with list of moden Linux APIs used
### Fixes
- Fix #27: possible buffer overrun in `uev_run()`, found by Steve Palmer
[v2.4.0][] - 2021-10-03 [v2.4.0][] - 2021-10-03
----------------------- -----------------------
@@ -444,6 +454,7 @@ Lua users mailing list.
[UNRELEASED]: https://github.com/troglobit/libuev/compare/v2.4.0...HEAD [UNRELEASED]: https://github.com/troglobit/libuev/compare/v2.4.0...HEAD
[v2.4.1]: https://github.com/troglobit/libuev/compare/v2.4.0...v2.4.1
[v2.4.0]: https://github.com/troglobit/libuev/compare/v2.3.2...v2.4.0 [v2.4.0]: https://github.com/troglobit/libuev/compare/v2.3.2...v2.4.0
[v2.3.2]: https://github.com/troglobit/libuev/compare/v2.3.1...v2.3.2 [v2.3.2]: https://github.com/troglobit/libuev/compare/v2.3.1...v2.3.2
[v2.3.1]: https://github.com/troglobit/libuev/compare/v2.3.0...v2.3.1 [v2.3.1]: https://github.com/troglobit/libuev/compare/v2.3.0...v2.3.1
+1 -1
View File
@@ -1,5 +1,5 @@
Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk> Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
Copyright (c) 2013-2021 Joachim Wiberg <troglobit()gmail!com> Copyright (c) 2013-2024 Joachim Wiberg <troglobit()gmail!com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
+7
View File
@@ -25,6 +25,13 @@ of APIs. It is similar to the more established [libevent][], [libev][]
and the venerable [Xt(3)][] event loop. The *µ* in the name refers to 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. both its limited feature set and the size impact of the library.
Linux APIs supported and wrapped for ease-of-use:
- `epoll(2)`
- `eventfd(2)`
- `signalfd(2)`
- `timerfd(2)`
Failure mode changes introduced in v2.0 may affect users of v1.x, See Failure mode changes introduced in v2.0 may affect users of v1.x, See
the [ChangeLog][] for the full details. the [ChangeLog][] for the full details.
+1 -1
View File
@@ -1,4 +1,4 @@
AC_INIT(libuev, 2.4.0, https://github.com/troglobit/libuev/issues) AC_INIT(libuev, 2.4.1, https://github.com/troglobit/libuev/issues)
AC_CONFIG_AUX_DIR(aux) AC_CONFIG_AUX_DIR(aux)
AM_INIT_AUTOMAKE([1.11 foreign dist-xz]) AM_INIT_AUTOMAKE([1.11 foreign dist-xz])
AM_SILENT_RULES([yes]) AM_SILENT_RULES([yes])
+7 -6
View File
@@ -2,7 +2,8 @@ Source: libuev
Section: libs Section: libs
Priority: optional Priority: optional
Maintainer: Joachim Wiberg <troglobit@gmail.com> Maintainer: Joachim Wiberg <troglobit@gmail.com>
Build-Depends: debhelper (>= 10), libtool Build-Depends: debhelper (>= 10)
Build-Depends-Indep: doxygen
Standards-Version: 4.3.0 Standards-Version: 4.3.0
Homepage: https://github.com/troglobit/libuev/ Homepage: https://github.com/troglobit/libuev/
Vcs-Browser: https://github.com/troglobit/libuev/ Vcs-Browser: https://github.com/troglobit/libuev/
@@ -12,7 +13,7 @@ Package: libuev-dev
Priority: optional Priority: optional
Section: libdevel Section: libdevel
Architecture: any Architecture: any
Depends: ${misc:Depends}, libuev2 (= ${binary:Version}) Depends: ${misc:Depends}, libuev3 (= ${binary:Version})
Description: static library, header files, and docs for libuev 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
. .
@@ -24,10 +25,10 @@ Description: static library, header files, and docs for libuev
Experienced developers may appreciate libuEv is built on top of modern Experienced developers may appreciate libuEv is built on top of modern
Linux APIs like epoll, eventfd, timerf, and signalfd. Linux APIs like epoll, eventfd, timerf, and signalfd.
Package: libuev2 Package: libuev3
Replaces: libuev Replaces: libuev, libuev2
Conflicts: libuev Conflicts: libuev, libuev2
Provides: libuev Provides: libuev, libuev2
Architecture: any Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends} Depends: ${misc:Depends}, ${shlibs:Depends}
Description: Lightweight event loop library for Linux Description: Lightweight event loop library for Linux
+1 -1
View File
@@ -14,7 +14,7 @@ Copyright: 2016-2021 Joachim Wiberg <troglobit@gmail.com>
License: MIT License: MIT
Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk> Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
Copyright (c) 2013-2021 Joachim Wiberg <troglobit()gmail!com> Copyright (c) 2013-2024 Joachim Wiberg <troglobit()gmail!com>
. .
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
View File
File renamed without changes.
View File
File renamed without changes.
+2 -2
View File
@@ -1,5 +1,5 @@
libuev.so.2 libuev2 #MINVER# libuev.so.3 libuev3 #MINVER#
* Build-Depends-Package: libite-dev * Build-Depends-Package: libuev-dev
_uev_watcher_active@Base 2.3.0 _uev_watcher_active@Base 2.3.0
_uev_watcher_init@Base 2.3.0 _uev_watcher_init@Base 2.3.0
_uev_watcher_rearm@Base 2.3.0 _uev_watcher_rearm@Base 2.3.0
+1 -1
View File
@@ -1,6 +1,6 @@
/* Simple example of how to use libuEv with Linux joystick API /* Simple example of how to use libuEv with Linux joystick API
* *
* Copyright (c) 2014-2021 Joachim Wiberg <troglobit()gmail!com> * Copyright (c) 2014-2024 Joachim Wiberg <troglobit()gmail!com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
+1 -1
View File
@@ -1,7 +1,7 @@
/* libuEv - Micro event loop library /* libuEv - Micro event loop library
* *
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk> * Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
* Copyright (c) 2013-2021 Joachim Wiberg <troglobit()gmail!com> * Copyright (c) 2013-2024 Joachim Wiberg <troglobit()gmail!com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
+1 -1
View File
@@ -1,7 +1,7 @@
/* libuEv - Micro event loop library /* libuEv - Micro event loop library
* *
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk> * Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
* Copyright (c) 2013-2021 Joachim Wiberg <troglobit()gmail!com> * Copyright (c) 2013-2024 Joachim Wiberg <troglobit()gmail!com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
+1 -1
View File
@@ -1,7 +1,7 @@
/* libuEv - Micro event loop library /* libuEv - Micro event loop library
* *
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk> * Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
* Copyright (c) 2013-2021 Joachim Wiberg <troglobit()gmail!com> * Copyright (c) 2013-2024 Joachim Wiberg <troglobit()gmail!com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
+1 -1
View File
@@ -1,7 +1,7 @@
/* libuEv - Private methods and data types, do not use directly! /* libuEv - Private methods and data types, do not use directly!
* *
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk> * Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
* Copyright (c) 2013-2021 Joachim Wiberg <troglobit()gmail!com> * Copyright (c) 2013-2024 Joachim Wiberg <troglobit()gmail!com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
+1 -1
View File
@@ -1,7 +1,7 @@
/* libuEv - Micro event loop library /* libuEv - Micro event loop library
* *
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk> * Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
* Copyright (c) 2013-2021 Joachim Wiberg <troglobit()gmail!com> * Copyright (c) 2013-2024 Joachim Wiberg <troglobit()gmail!com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
+1 -1
View File
@@ -1,7 +1,7 @@
/* libuEv - Micro event loop library /* libuEv - Micro event loop library
* *
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk> * Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
* Copyright (c) 2013-2021 Joachim Wiberg <troglobit()gmail!com> * Copyright (c) 2013-2024 Joachim Wiberg <troglobit()gmail!com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
+14 -7
View File
@@ -1,7 +1,7 @@
/* libuEv - Micro event loop library /* libuEv - Micro event loop library
* *
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk> * Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
* Copyright (c) 2013-2021 Joachim Wiberg <troglobit()gmail!com> * Copyright (c) 2013-2024 Joachim Wiberg <troglobit()gmail!com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -196,11 +196,11 @@ int uev_init(uev_ctx_t *ctx)
/** /**
* Create an event loop context * Create an event loop context
* @param ctx Pointer to an uev_ctx_t context to be initialized * @param ctx Pointer to an uev_ctx_t context to be initialized
* @param maxevents Maximum number of events in event cache * @param maxevents Maximum number of events in event cache [1, 10]
* *
* This function is the same as uev_init() except for the @p maxevents * This function is the same as uev_init() except for the @p maxevents
* argument, which controls the number of events in the event cache * argument, max ::UEV_MAX_EVENTS, which controls the number of events
* returned to the main loop. * in the event cache returned to the main loop.
* *
* In cases where you have multiple events pending in the cache and some * In cases where you have multiple events pending in the cache and some
* event may cause later ones, already sent by the kernel to userspace, * event may cause later ones, already sent by the kernel to userspace,
@@ -222,6 +222,9 @@ int uev_init1(uev_ctx_t *ctx, int maxevents)
return -1; return -1;
} }
if (maxevents > UEV_MAX_EVENTS)
maxevents = UEV_MAX_EVENTS;
memset(ctx, 0, sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx));
ctx->maxevents = maxevents; ctx->maxevents = maxevents;
@@ -295,8 +298,8 @@ int uev_exit(uev_ctx_t *ctx)
*/ */
int uev_run(uev_ctx_t *ctx, int flags) int uev_run(uev_ctx_t *ctx, int flags)
{ {
uev_t *w;
int timeout = -1; int timeout = -1;
uev_t *w;
if (!ctx || ctx->fd < 0) { if (!ctx || ctx->fd < 0) {
errno = EINVAL; errno = EINVAL;
@@ -319,8 +322,12 @@ int uev_run(uev_ctx_t *ctx, int flags)
while (ctx->running && ctx->watchers) { while (ctx->running && ctx->watchers) {
struct epoll_event ee[UEV_MAX_EVENTS]; struct epoll_event ee[UEV_MAX_EVENTS];
int maxevents = ctx->maxevents;
int i, nfds, rerun = 0; int i, nfds, rerun = 0;
if (maxevents > UEV_MAX_EVENTS)
maxevents = UEV_MAX_EVENTS;
/* Handle special case: `application < file.txt` */ /* Handle special case: `application < file.txt` */
if (ctx->workaround) { if (ctx->workaround) {
_UEV_FOREACH(w, ctx->watchers) { _UEV_FOREACH(w, ctx->watchers) {
@@ -341,7 +348,7 @@ int uev_run(uev_ctx_t *ctx, int flags)
continue; continue;
ctx->workaround = 0; ctx->workaround = 0;
while ((nfds = epoll_wait(ctx->fd, ee, ctx->maxevents, timeout)) < 0) { while ((nfds = epoll_wait(ctx->fd, ee, maxevents, timeout)) < 0) {
if (!ctx->running) if (!ctx->running)
break; break;
@@ -356,9 +363,9 @@ int uev_run(uev_ctx_t *ctx, int flags)
for (i = 0; ctx->running && i < nfds; i++) { for (i = 0; ctx->running && i < nfds; i++) {
struct signalfd_siginfo fdsi; struct signalfd_siginfo fdsi;
ssize_t sz = sizeof(fdsi);
uint32_t events; uint32_t events;
uint64_t exp; uint64_t exp;
ssize_t sz = sizeof(fdsi);
w = (uev_t *)ee[i].data.ptr; w = (uev_t *)ee[i].data.ptr;
events = ee[i].events; events = ee[i].events;
+1 -1
View File
@@ -1,7 +1,7 @@
/* libuEv - Micro event loop library /* libuEv - Micro event loop library
* *
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk> * Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
* Copyright (c) 2013-2021 Joachim Wiberg <troglobit()gmail!com> * Copyright (c) 2013-2024 Joachim Wiberg <troglobit()gmail!com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
+1 -1
View File
@@ -1,7 +1,7 @@
/* Test libuEv event library /* Test libuEv event library
* *
* Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk> * Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
* Copyright (c) 2013-2021 Joachim Wiberg <troglobit()gmail!com> * Copyright (c) 2013-2024 Joachim Wiberg <troglobit()gmail!com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
+1 -1
View File
@@ -1,6 +1,6 @@
/* Test cron API in libuEv event library /* Test cron API in libuEv event library
* *
* Copyright (c) 2016-2021 Joachim Wiberg <troglobit()gmail!com> * Copyright (c) 2016-2024 Joachim Wiberg <troglobit()gmail!com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
+1 -1
View File
@@ -1,6 +1,6 @@
/* Verifies eventfd support /* Verifies eventfd support
* *
* Copyright (c) 2018-2021 Joachim Wiberg <troglobit@gmail.com> * Copyright (c) 2018-2024 Joachim Wiberg <troglobit@gmail.com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
+2 -2
View File
@@ -1,6 +1,6 @@
/* Multiple signals, segfault and fork() to test sub-processes. /* Multiple signals, segfault and fork() to test sub-processes.
* *
* Copyright (c) 2015-2021 Joachim Wiberg <troglobit@gmail.com> * Copyright (c) 2015-2024 Joachim Wiberg <troglobit@gmail.com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -78,7 +78,7 @@ static void sig_cb(uev_t *w, void *cbarg, int events)
break; break;
case SIGCHLD: case SIGCHLD:
if (arg->pid != w->siginfo.ssi_pid) if (arg->pid != (pid_t)w->siginfo.ssi_pid)
err(1, "wrong child exited pid %d vs ssi_pid %d", err(1, "wrong child exited pid %d vs ssi_pid %d",
arg->pid, w->siginfo.ssi_pid); arg->pid, w->siginfo.ssi_pid);