mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
registry: handle fsync interrupted by signal (EINTR)
According to [1] EINTR is a possible errno for fsync(), so handle it as all other EINTR (do/while(errno == EINTR)). Signed-off-by: Peter Seiderer <ps.report@gmx.net>
This commit is contained in:
parent
afa802e4aa
commit
96aa27910a
1 changed files with 9 additions and 2 deletions
|
@ -241,9 +241,16 @@ gst_registry_binary_cache_write (BinaryRegistryCache * cache,
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_registry_binary_cache_finish (BinaryRegistryCache * cache, gboolean success)
|
gst_registry_binary_cache_finish (BinaryRegistryCache * cache, gboolean success)
|
||||||
{
|
{
|
||||||
|
gint fsync_ret;
|
||||||
|
|
||||||
/* only fsync if we're actually going to use and rename the file below */
|
/* only fsync if we're actually going to use and rename the file below */
|
||||||
if (success && fsync (cache->cache_fd) < 0)
|
if (success) {
|
||||||
goto fsync_failed;
|
do {
|
||||||
|
fsync_ret = fsync (cache->cache_fd);
|
||||||
|
} while (fsync_ret < 0 && errno == EINTR);
|
||||||
|
if (fsync_ret)
|
||||||
|
goto fsync_failed;
|
||||||
|
}
|
||||||
|
|
||||||
if (close (cache->cache_fd) < 0)
|
if (close (cache->cache_fd) < 0)
|
||||||
goto close_failed;
|
goto close_failed;
|
||||||
|
|
Loading…
Reference in a new issue