[sysprof] build: check ftruncate result



commit 3179658daa97874d31fa688e829786d7f6473668
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jun 3 12:41:48 2019 -0700

    build: check ftruncate result

 src/libsysprof-capture/sysprof-capture-writer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libsysprof-capture/sysprof-capture-writer.c b/src/libsysprof-capture/sysprof-capture-writer.c
index d7ef09d..bc2b21c 100644
--- a/src/libsysprof-capture/sysprof-capture-writer.c
+++ b/src/libsysprof-capture/sysprof-capture-writer.c
@@ -427,7 +427,7 @@ sysprof_capture_writer_new_from_fd (int   fd,
   g_assert (buffer_size % _sysprof_getpagesize() == 0);
 
   /* This is only useful on files, memfd, etc */
-  ftruncate (fd, 0);
+  if (ftruncate (fd, 0) != 0) { /* Do Nothing */ }
 
   self = g_new0 (SysprofCaptureWriter, 1);
   self->ref_count = 1;


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