projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: address shellcheck warnings/errors in example scripts
[lttng-ust.git]
/
libringbuffer
/
shm.c
diff --git
a/libringbuffer/shm.c
b/libringbuffer/shm.c
index c4c651e4b925543e373e9b016398636be4c03293..ea946ea3f5e2a6d2e46d3297ebe925135164272e 100644
(file)
--- a/
libringbuffer/shm.c
+++ b/
libringbuffer/shm.c
@@
-134,6
+134,15
@@
struct shm_object *_shm_object_table_alloc_shm(struct shm_object_table *table,
PERROR("ftruncate");
goto error_ftruncate;
}
PERROR("ftruncate");
goto error_ftruncate;
}
+ /*
+ * Also ensure the file metadata is synced with the storage by using
+ * fsync(2).
+ */
+ ret = fsync(shmfd);
+ if (ret) {
+ PERROR("fsync");
+ goto error_fsync;
+ }
obj->shm_fd_ownership = 0;
obj->shm_fd = shmfd;
obj->shm_fd_ownership = 0;
obj->shm_fd = shmfd;
@@
-153,6
+162,7
@@
struct shm_object *_shm_object_table_alloc_shm(struct shm_object_table *table,
return obj;
error_mmap:
return obj;
error_mmap:
+error_fsync:
error_ftruncate:
error_zero_file:
error_fcntl:
error_ftruncate:
error_zero_file:
error_fcntl:
This page took
0.023708 seconds
and
4
git commands to generate.