From 3179658daa97874d31fa688e829786d7f6473668 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Mon, 3 Jun 2019 12:41:48 -0700 Subject: [PATCH] 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 d7ef09d1..bc2b21ce 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;