NetworkManager/shared/nm-glib-aux
Thomas Haller 500f0b96ae
all: use wrappers for g_ascii_strtoll(), g_ascii_strtoull(), g_ascii_strtod()
Sometimes these function may set errno to unexpected values like EAGAIN.
This causes confusion. Avoid that by using our own wrappers that retry
in that case. For example, in rhbz#1797915 we have failures like:

    errno = 0;
    v = g_ascii_strtoll ("10", 0, &end);
    if (errno != 0)
        g_assert_not_reached ();

as g_ascii_strtoll() would return 10, but also set errno to EAGAIN.

Work around that by using wrapper functions that retry. This certainly
should be fixed in glib (or glibc), but the issues are severe enough to
warrant a workaround.

Note that our workarounds are very defensive. We only retry 2 times, if
we get an unexpected errno value. This is in the hope to recover from
a spurious EAGAIN. It won't recover from other errors.

https://bugzilla.redhat.com/show_bug.cgi?id=1797915
(cherry picked from commit 7e49f4a199)
(cherry picked from commit eec2740d71)
2020-05-02 14:57:53 +02:00
..
nm-c-list.h shared: add nm_c_list_elem_free_steal() util 2019-07-02 17:52:53 +02:00
nm-dbus-aux.c shared: add nm_dbus_connection_signal_subscribe_name_owner_changed() helper 2019-05-12 09:56:36 +02:00
nm-dbus-aux.h shared: add nm_dbus_connection_call_start_service_by_name() helper 2019-05-12 09:56:36 +02:00
nm-dedup-multi.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dedup-multi.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-enum-utils.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-enum-utils.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-errno.c shared: move most of "shared/nm-utils" to "shared/nm-glib-aux" 2019-04-18 19:57:27 +02:00
nm-errno.h shared: move most of "shared/nm-utils" to "shared/nm-glib-aux" 2019-04-18 19:57:27 +02:00
nm-glib.h shared/glib: reimplement g_atomic_pointer_compare_and_exchange() macro 2020-04-20 09:33:16 +02:00
nm-hash-utils.c shared: add nm_pdirect_hash()/nm_pdirect_equal() 2019-07-10 12:43:06 +02:00
nm-hash-utils.h shared: add NM_HASH_SEED_16() macro 2019-07-31 10:44:37 +02:00
nm-io-utils.c shared: add nm_utils_file_stat() util 2019-06-26 09:53:54 +02:00
nm-io-utils.h shared: add nm_utils_file_stat() util 2019-06-26 09:53:54 +02:00
nm-jansson.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-json-aux.c shared: add nm_json_aux_gstr_append_*() helper 2019-05-23 18:09:49 +02:00
nm-json-aux.h shared: add JSON helper functions for NMValueType 2019-05-23 18:09:49 +02:00
nm-keyfile-aux.c shared: fix non-serious bug with bogus condition in assertion in nm_key_file_db_ref() 2019-08-01 17:25:37 +02:00
nm-keyfile-aux.h shared: add NMKeyFileDB API 2019-05-07 16:41:21 +02:00
nm-logging-fwd.h shared: implement _nm_utils_monotonic_timestamp_initialized() in "nm-logging-stub.c" 2019-05-22 20:04:08 +02:00
nm-macros-internal.h shared: add nm_g_slice_free() helper 2019-07-25 15:26:49 +02:00
nm-obj.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-random-utils.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-random-utils.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-secret-utils.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-secret-utils.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-shared-utils.c all: use wrappers for g_ascii_strtoll(), g_ascii_strtoull(), g_ascii_strtod() 2020-05-02 14:57:53 +02:00
nm-shared-utils.h shared: add nm_g_ascii_strtoull() to workaround bug 2020-05-02 14:57:32 +02:00
nm-time-utils.c core: improve code comment and add assertion to nm_utils_monotonic_timestamp_as_boottime() 2019-07-25 15:10:43 +02:00
nm-time-utils.h shared: add nm_utils_clock_gettime_*() util 2019-07-23 12:19:22 +02:00
nm-value-type.h shared: fix return in nm_value_type_to_variant()/nm_value_type_get_variant_type() 2019-05-27 13:27:13 +02:00