[sysprof] capture: use _sp_sendfile() on non-Linux platforms



commit 8ec9fea5cb0f10e30e77704a9d34ca1a395e28fd
Author: Christian Hergert <chergert redhat com>
Date:   Mon May 6 16:21:43 2019 -0700

    capture: use _sp_sendfile() on non-Linux platforms
    
    We still generally only build on Linux from the Sysprof
    project, but we can start to support other systems in the
    capture format (with the possibility of being more general
    for the UI later on too).

 lib/capture/sp-capture-reader.c | 4 ++--
 lib/capture/sp-capture-writer.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/lib/capture/sp-capture-reader.c b/lib/capture/sp-capture-reader.c
index 71b8b57..c91aa85 100644
--- a/lib/capture/sp-capture-reader.c
+++ b/lib/capture/sp-capture-reader.c
@@ -19,12 +19,12 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <string.h>
-#include <sys/sendfile.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
 
 #include "capture/sp-capture-reader.h"
+#include "capture/sp-capture-util-private.h"
 #include "capture/sp-capture-writer.h"
 
 struct _SpCaptureReader
@@ -842,7 +842,7 @@ sp_capture_reader_save_as (SpCaptureReader  *self,
     {
       gssize written;
 
-      written = sendfile (fd, self->fd, &in_off, to_write);
+      written = _sp_sendfile (fd, self->fd, &in_off, to_write);
 
       if (written < 0)
         goto handle_errno;
diff --git a/lib/capture/sp-capture-writer.c b/lib/capture/sp-capture-writer.c
index 9cb6380..2525063 100644
--- a/lib/capture/sp-capture-writer.c
+++ b/lib/capture/sp-capture-writer.c
@@ -24,12 +24,12 @@
 #include <fcntl.h>
 #include <glib/gstdio.h>
 #include <string.h>
-#include <sys/sendfile.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
 
 #include "capture/sp-capture-reader.h"
+#include "capture/sp-capture-util-private.h"
 #include "capture/sp-capture-writer.h"
 
 #define DEFAULT_BUFFER_SIZE (getpagesize() * 64L)
@@ -829,7 +829,7 @@ sp_capture_writer_save_as (SpCaptureWriter            *self,
     {
       gssize written;
 
-      written = sendfile (fd, self->fd, &in_off, pos);
+      written = _sp_sendfile (fd, self->fd, &in_off, pos);
 
       if (written < 0)
         goto handle_errno;
@@ -908,7 +908,7 @@ _sp_capture_writer_splice_from_fd (SpCaptureWriter  *self,
     {
       gssize written;
 
-      written = sendfile (self->fd, fd, &in_off, to_write);
+      written = _sp_sendfile (self->fd, fd, &in_off, to_write);
 
       if (written < 0)
         goto handle_errno;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]