mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-28 10:07:13 +02:00
gstrfuncs: Expand documentation for errno functions
Mention that it really is a good idea to save errno before doing literally anything else after calling a function which could set it. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=785577
This commit is contained in:
@@ -52,6 +52,18 @@ G_DEFINE_QUARK (g-io-error-quark, g_io_error)
|
||||
* handled (but note that future GLib releases may return a more
|
||||
* specific value instead).
|
||||
*
|
||||
* As %errno is global and may be modified by intermediate function
|
||||
* calls, you should save its value as soon as the call which sets it
|
||||
* returns:
|
||||
* |[
|
||||
* int saved_errno;
|
||||
*
|
||||
* ret = read (blah);
|
||||
* saved_errno = errno;
|
||||
*
|
||||
* g_io_error_from_errno (saved_errno);
|
||||
* ]|
|
||||
*
|
||||
* Returns: #GIOErrorEnum value for the given errno.h error number.
|
||||
**/
|
||||
GIOErrorEnum
|
||||
|
Reference in New Issue
Block a user