mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 06:26:15 +01:00
5cddde1fb2
Prevent the situation where errno is set by function A, then function B is called (which is typically _(), but could be anything else) and it overwrites errno, then errno is checked by the caller. errno is a horrific API, and we need to be careful to save its value as soon as a function call (which might set it) returns. i.e. Follow the pattern: int errsv, ret; ret = some_call_which_might_set_errno (); errsv = errno; if (ret < 0) puts (strerror (errsv)); This patch implements that pattern throughout GLib. There might be a few places in the test code which still use errno directly. They should be ported as necessary. It doesn’t modify all the call sites like this: if (some_call_which_might_set_errno () && errno == ESOMETHING) since the refactoring involved is probably more harmful than beneficial there. It does, however, refactor other call sites regardless of whether they were originally buggy. https://bugzilla.gnome.org/show_bug.cgi?id=785577 |
||
---|---|---|
.. | ||
collate | ||
gobject | ||
refcount | ||
.gitignore | ||
assert-msg-test.c | ||
assert-msg-test.gdb | ||
asyncqueue-test.c | ||
atomic-test.c | ||
bit-test.c | ||
casefold.txt | ||
casemap.txt | ||
child-test.c | ||
completion-test.c | ||
cxx-test.C | ||
datetime.c | ||
dirname-test.c | ||
env-test.c | ||
file-test.c | ||
gen-casefold-txt.pl | ||
gen-casemap-txt.pl | ||
gio-ls.c | ||
gio-test.c | ||
iochannel-test-infile | ||
iochannel-test.c | ||
libmoduletestplugin_a.c | ||
libmoduletestplugin_b.c | ||
mainloop-test.c | ||
Makefile.am | ||
mapping-test.c | ||
memchunks.c | ||
meson.build | ||
module-test.c | ||
onceinit.c | ||
qsort-test.c | ||
relation-test.c | ||
run-assert-msg-test.sh | ||
run-collate-tests.sh | ||
slice-color.c | ||
slice-concurrent.c | ||
slice-test.c | ||
slice-threadinit.c | ||
sources.c | ||
spawn-test-win32-gui.c | ||
spawn-test.c | ||
testgdate.c | ||
testgdateparser.c | ||
testglib.c | ||
thread-test.c | ||
threadpool-test.c | ||
timeloop-basic.c | ||
timeloop.c | ||
type-test.c | ||
unicode-caseconv.c | ||
unicode-collate.c | ||
unicode-encoding.c | ||
unicode-normalize.c | ||
utf8.txt |