[Bug 757596] filesink: left in half cleaned in case of fclose failure

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Nov 5 01:19:15 PST 2015


https://bugzilla.gnome.org/show_bug.cgi?id=757596

--- Comment #3 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
commit f468eb7db023e110c06ad163cf48908107cf0382
Author: Anton Bondarenko <antonbo at axis.com>
Date:   Thu Nov 5 08:56:43 2015 +0100

    filesink: continue element cleanup even if fclose fails

    Sometimes filesink cleanup during stop may fail due to fclose error.
    In this case object left partial cleanup with no file opened
    but still holding old file descriptor.

    It's not possible to change location property in a such state,
    so next start will cause old file overwrite if 'append' does not set.

    According to man page and POSIX standard about fclose behavior(extract):
    ------------------------------------------------------------------------
    The fclose() function shall cause the stream pointed to by stream
    to be flushed and the associated file to be closed.
    ...
    Whether or not the call succeeds, the stream shall be disassociated
    from the file and any buffer set by the setbuf() or setvbuf()
    function shall be disassociated from the stream.
    ...
    The fclose() function shall perform the equivalent of a close()
    on the file descriptor that is associated with the stream
    pointed to by stream.

    After the call to fclose(), any use of stream results
    in undefined behavior.
    ------------------------------------------------------------------------

    So file is in 'closed' state no matter if fclose succeed or not.
    And cleanup could be continued.

    https://bugzilla.gnome.org/show_bug.cgi?id=757596

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list