m/b/circular: check ftruncate return value

This commit is contained in:
Danny Robson 2015-11-13 17:17:02 +11:00
parent 8b16317b0e
commit 584b57b669

View File

@ -84,7 +84,8 @@ circular::circular (size_t bytes)
util::scoped_function raii ([&name] (void) { shm_unlink (name.c_str ()); });
// embiggen to the desired size
ftruncate (fd, bytes);
if (ftruncate (fd, bytes))
errno_error::throw_code ();
// pre-allocate a sufficiently large virtual memory block. it doesn't
// matter much what flags we use because we'll just be overwriting it