Fix consumer to handle compat layer
authorDavid Goulet <dgoulet@efficios.com>
Tue, 21 Feb 2012 22:46:24 +0000 (17:46 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 22 Feb 2012 22:25:30 +0000 (17:25 -0500)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/Makefile.am
src/common/consumer.c
src/common/consumer.h
src/common/ust-consumer/ust-consumer.c

index 37f9acb9ab144b9a7ce711b4062d62a82bc78a4a..ba93810a8c3fe6af5bf8bd7c4188d037de4421ec 100644 (file)
@@ -10,6 +10,17 @@ noinst_LTLIBRARIES = libcommon.la
 
 libcommon_la_SOURCES = runas.c runas.h common.h
 
+if COMPAT_EPOLL
+COMPAT=compat/compat-epoll.c
+else
+COMPAT=compat/compat-poll.c
+endif
+
+noinst_LTLIBRARIES += libcompat.la
+
+libcompat_la_SOURCES = compat/poll.h compat/fcntl.h compat/splice.h compat/endian.h \
+                       compat/socket.h compat/compat-fcntl.c $(COMPAT)
+
 # Consumer library
 noinst_LTLIBRARIES += libconsumer.la
 
@@ -18,19 +29,10 @@ libconsumer_la_SOURCES = consumer.c consumer.h
 libconsumer_la_LIBADD = \
                $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \
                $(top_builddir)/src/common/kernel-consumer/libkernel-consumer.la \
-               $(top_builddir)/src/common/hashtable/libhashtable.la
+               $(top_builddir)/src/common/hashtable/libhashtable.la \
+               $(top_builddir)/src/common/libcompat.la
 
 if HAVE_LIBLTTNG_UST_CTL
 libconsumer_la_LIBADD += \
                $(top_builddir)/src/common/ust-consumer/libust-consumer.la
 endif
-
-if COMPAT_EPOLL
-COMPAT=compat/compat-epoll.c
-else
-COMPAT=compat/compat-poll.c
-endif
-
-noinst_LTLIBRARIES += libcompat.la
-
-libcompat_la_SOURCES = compat/poll.h $(COMPAT)
index b605591e478a1c2a40dd13a25228bd2ad80bc684..80dedd5c6cfd057397eef3706ec62ef9717889e7 100644 (file)
@@ -19,7 +19,6 @@
 
 #define _GNU_SOURCE
 #include <assert.h>
-#include <fcntl.h>
 #include <poll.h>
 #include <pthread.h>
 #include <stdlib.h>
@@ -601,7 +600,7 @@ void lttng_consumer_sync_trace_file(
        if (orig_offset < stream->chan->max_sb_size) {
                return;
        }
-       sync_file_range(outfd, orig_offset - stream->chan->max_sb_size,
+       lttng_sync_file_range(outfd, orig_offset - stream->chan->max_sb_size,
                        stream->chan->max_sb_size,
                        SYNC_FILE_RANGE_WAIT_BEFORE
                        | SYNC_FILE_RANGE_WRITE
@@ -742,6 +741,8 @@ int lttng_consumer_on_read_subbuffer_mmap(
                ERR("Unknown consumer_data type");
                assert(0);
        }
+
+       return 0;
 }
 
 /*
index dc5fc9968be02fbf45b223ef20a8371fdc4e0005..35a72b50f6078e333f1fe754de5f183417b71767 100644 (file)
@@ -26,7 +26,8 @@
 
 #include <lttng/lttng.h>
 
-#include "src/common/hashtable/hashtable.h"
+#include <common/hashtable/hashtable.h>
+#include <common/compat/fcntl.h>
 
 /*
  * When the receiving thread dies, we need to have a way to make the polling
index 9a5775b8ed3bff1bf996dc244516b1dce2685257..e81f05041249a164ce09151e9907c0602b41d6be 100644 (file)
@@ -19,7 +19,6 @@
 
 #define _GNU_SOURCE
 #include <assert.h>
-#include <fcntl.h>
 #include <poll.h>
 #include <pthread.h>
 #include <stdlib.h>
This page took 0.028972 seconds and 4 git commands to generate.