summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorSergey Matveychuk <sem@FreeBSD.org>2007-10-09 20:01:32 +0000
committerSergey Matveychuk <sem@FreeBSD.org>2007-10-09 20:01:32 +0000
commit6313cad8cea7c34283d0c6bf8365a8a744fdf334 (patch)
tree3e9bb2de9b6b5c15a65113cab790d6a973fd0ec2 /devel
parentUpgrade to iReport-2.0.2. (diff)
- Fix a bug when pevent makes a wrong count when time intervals don't
devisible by a second. Submitted by: maintainer
Notes
Notes: svn path=/head/; revision=201210
Diffstat (limited to 'devel')
-rw-r--r--devel/libpdel/Makefile2
-rw-r--r--devel/libpdel/files/patch-util_pevent.c29
2 files changed, 22 insertions, 9 deletions
diff --git a/devel/libpdel/Makefile b/devel/libpdel/Makefile
index 975c1954dcfb..0d88686da37d 100644
--- a/devel/libpdel/Makefile
+++ b/devel/libpdel/Makefile
@@ -7,7 +7,7 @@
PORTNAME= libpdel
PORTVERSION= 0.5.3
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= devel net www
MASTER_SITES= LOCAL/archie
diff --git a/devel/libpdel/files/patch-util_pevent.c b/devel/libpdel/files/patch-util_pevent.c
index 661ce558f5cc..665bcaaf850e 100644
--- a/devel/libpdel/files/patch-util_pevent.c
+++ b/devel/libpdel/files/patch-util_pevent.c
@@ -1,6 +1,6 @@
--- util/pevent.c 2005/09/10 20:19:46 972
-+++ util/pevent.c 2006/10/07 23:59:17 980
-@@ -122,6 +122,15 @@
++++ util/pevent.c 2007/10/09 19:56:17 980
+@@ -155,6 +155,15 @@
_pevent_unref(ev); \
} while (0)
@@ -16,7 +16,20 @@
/* Internal functions */
static void pevent_ctx_service(struct pevent *ev);
static void *pevent_ctx_main(void *arg);
-@@ -436,7 +445,7 @@
+@@ -338,7 +347,11 @@
+ ev->u.millis = 0;
+ gettimeofday(&ev->when, NULL);
+ ev->when.tv_sec += ev->u.millis / 1000;
+- ev->when.tv_usec += ev->u.millis % 1000;
++ ev->when.tv_usec += (ev->u.millis % 1000) * 1000;
++ if (ev->when.tv_usec > 1000000) {
++ ev->when.tv_sec++;
++ ev->when.tv_usec -= 1000000;
++ }
+ break;
+ case PEVENT_MESG_PORT:
+ va_start(args, type);
+@@ -469,7 +482,7 @@
goto done;
/* Mark event as having occurred */
@@ -25,7 +38,7 @@
/* Wake up thread if event is still in the queue */
if ((ev->flags & PEVENT_ENQUEUED) != 0)
-@@ -490,6 +499,7 @@
+@@ -523,6 +536,7 @@
struct timeval now;
struct pollfd *fd;
struct pevent *ev;
@@ -33,7 +46,7 @@
int poll_idx;
int timeout;
int r;
-@@ -529,6 +539,13 @@
+@@ -562,6 +576,13 @@
}
}
@@ -47,7 +60,7 @@
/* Add event for the notify pipe */
poll_idx = 0;
if (ctx->fds_alloc > 0) {
-@@ -587,7 +604,7 @@
+@@ -620,7 +641,7 @@
switch (ev->type) {
case PEVENT_MESG_PORT:
if (mesg_port_qlen(ev->u.port) > 0)
@@ -56,7 +69,7 @@
break;
default:
break;
-@@ -621,7 +638,8 @@
+@@ -654,7 +675,8 @@
gettimeofday(&now, NULL);
/* Mark poll() events that have occurred */
@@ -66,7 +79,7 @@
assert(ev->magic == PEVENT_MAGIC);
switch (ev->type) {
case PEVENT_READ:
-@@ -631,33 +649,23 @@
+@@ -664,33 +686,23 @@
fd = &ctx->fds[ev->poll_idx];
if ((fd->revents & ((ev->type == PEVENT_READ) ?
READABLE_EVENTS : WRITABLE_EVENTS)) != 0)