dovecot-2.2: lib: io_add_notify() wasn't setting struct io.sourc...

dovecot at dovecot.org dovecot at dovecot.org
Wed Aug 19 18:25:41 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/d26178d0557a
changeset: 18984:d26178d0557a
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Aug 19 21:24:50 2015 +0300
description:
lib: io_add_notify() wasn't setting struct io.source_linenum

diffstat:

 src/lib/ioloop-notify-inotify.c |  6 ++++--
 src/lib/ioloop-notify-kqueue.c  |  6 ++++--
 src/lib/ioloop-notify-none.c    |  1 +
 src/lib/ioloop.h                |  7 ++++---
 4 files changed, 13 insertions(+), 7 deletions(-)

diffs (75 lines):

diff -r 637e005a5559 -r d26178d0557a src/lib/ioloop-notify-inotify.c
--- a/src/lib/ioloop-notify-inotify.c	Wed Aug 19 20:49:12 2015 +0300
+++ b/src/lib/ioloop-notify-inotify.c	Wed Aug 19 21:24:50 2015 +0300
@@ -85,8 +85,9 @@
 }
 
 #undef io_add_notify
-enum io_notify_result io_add_notify(const char *path, io_callback_t *callback,
-				    void *context, struct io **io_r)
+enum io_notify_result
+io_add_notify(const char *path, unsigned int source_linenum,
+	      io_callback_t *callback, void *context, struct io **io_r)
 {
 	struct ioloop_notify_handler_context *ctx =
 		current_ioloop->notify_handler_context;
@@ -125,6 +126,7 @@
 	}
 
 	*io_r = io_notify_fd_add(&ctx->fd_ctx, wd, callback, context);
+	(*io_r)->source_linenum = source_linenum;
 	return IO_NOTIFY_ADDED;
 }
 
diff -r 637e005a5559 -r d26178d0557a src/lib/ioloop-notify-kqueue.c
--- a/src/lib/ioloop-notify-kqueue.c	Wed Aug 19 20:49:12 2015 +0300
+++ b/src/lib/ioloop-notify-kqueue.c	Wed Aug 19 21:24:50 2015 +0300
@@ -104,8 +104,9 @@
 }
 
 #undef io_add_notify
-enum io_notify_result io_add_notify(const char *path, io_callback_t *callback,
-				    void *context, struct io **io_r)
+enum io_notify_result
+io_add_notify(const char *path, unsigned int source_linenum,
+	      io_callback_t *callback, void *context, struct io **io_r)
 {
 	struct ioloop_notify_handler_context *ctx =
 		current_ioloop->notify_handler_context;
@@ -128,6 +129,7 @@
 
 	io = i_new(struct io_notify, 1);
 	io->io.condition = IO_NOTIFY;
+	io->io.source_linenum = source_linenum;
 	io->io.callback = callback;
 	io->io.context = context;
 	io->io.ioloop = current_ioloop;
diff -r 637e005a5559 -r d26178d0557a src/lib/ioloop-notify-none.c
--- a/src/lib/ioloop-notify-none.c	Wed Aug 19 20:49:12 2015 +0300
+++ b/src/lib/ioloop-notify-none.c	Wed Aug 19 21:24:50 2015 +0300
@@ -8,6 +8,7 @@
 #undef io_add_notify
 enum io_notify_result
 io_add_notify(const char *path ATTR_UNUSED,
+	      unsigned int source_linenum ATTR_UNUSED,
 	      io_callback_t *callback ATTR_UNUSED,
 	      void *context ATTR_UNUSED, struct io **io_r)
 {
diff -r 637e005a5559 -r d26178d0557a src/lib/ioloop.h
--- a/src/lib/ioloop.h	Wed Aug 19 20:49:12 2015 +0300
+++ b/src/lib/ioloop.h	Wed Aug 19 21:24:50 2015 +0300
@@ -55,10 +55,11 @@
 		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
 		(io_callback_t *)callback, context)
 enum io_notify_result
-io_add_notify(const char *path, io_callback_t *callback,
-	      void *context, struct io **io_r) ATTR_NULL(3);
+io_add_notify(const char *path, unsigned int source_linenum,
+	      io_callback_t *callback, void *context,
+	      struct io **io_r) ATTR_NULL(3);
 #define io_add_notify(path, callback, context, io_r) \
-	io_add_notify(path + \
+	io_add_notify(path, __LINE__ + \
 		CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
 		(io_callback_t *)callback, context, io_r)
 struct io *io_add_istream(struct istream *input, unsigned int source_linenum,


More information about the dovecot-cvs mailing list