gstdio: Document errno behaviour of g_clear_fd

g_clear_fd has the same interaction with errno as g_close or most libc
functions: on success it has an unspecified effect on errno, and on
failure (other than programming error) it sets errno to indicate the
reason for failure.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2022-10-28 14:54:53 +01:00
parent 088d8b4359
commit e231132fc3

View File

@ -1845,6 +1845,10 @@ g_close (gint fd,
* anything.
* In both cases, set @fd_ptr to `-1` before returning.
*
* Like g_close(), if closing the file descriptor fails, the error is
* stored in both %errno and @error. If this function succeeds,
* %errno is undefined.
*
* It is a programming error for @fd_ptr to point to a non-negative
* number that is not a valid file descriptor.
*