mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-04 22:48:54 +00:00
registry: fix lseek() return code handling
lseek() returns the offset if successful, and this is != 0 and does not indicate an error. And if it does actually fail, don't return FALSE (0) as an int, but -1. None of these things are likely to have made a difference, ever. I don't think the offset seek can ever actually happen, the current file position and the current offset should always be increased in lock step, unless there was an error in which case we'd just error out.
This commit is contained in:
parent
c25b8e153d
commit
031514faeb
1 changed files with 4 additions and 3 deletions
|
@ -219,10 +219,11 @@ gst_registry_binary_cache_write (BinaryRegistryCache * cache,
|
|||
{
|
||||
long written;
|
||||
if (offset != cache->currentoffset) {
|
||||
if (lseek (cache->cache_fd, offset, SEEK_SET) != 0) {
|
||||
GST_ERROR ("Seeking to new offset failed");
|
||||
return FALSE;
|
||||
if (lseek (cache->cache_fd, offset, SEEK_SET) < 0) {
|
||||
GST_ERROR ("Seeking to new offset failed: %s", g_strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
GST_LOG ("Seeked from offset %lu to %lu", offset, cache->currentoffset);
|
||||
cache->currentoffset = offset;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue