NetworkManager/shared
Thomas Haller 67130e6706 shared: cleanup separation and transition between errno and nmerr numbers
The native error numbers (from <errno.h>) and our nmerr extention on top
of them are almost the same. But there are peculiarities.

Both errno and nmerr must be positive values. That is because some API
(systemd) like to return negative error codes. So, a positive errno and
its negative counter part indicate the same error. We need normalization
functions that make an error number positive (these are nm_errno() and
nm_errno_native()).

This means, G_MININT needs special treatment, because it cannot be
represented as a positive integer. Also, zero needs special
treatment, because we want to encode an error, and zero already encodes
no-error. Take care of these special cases.

On top of that, nmerr reserves a range within native error numbers for
NetworkManager specific failure codes. So we need to transition from native
numbers to nmerr numbers via nm_errno_from_native().

Take better care of some special cases and clean them up.

Also add NM_ERRNO_NATIVE() macro. While nm_errno_native() coerces a
value in the suitable range, NM_ERRNO_NATIVE() asserts that the number
is already positive (and returns it as-is). It's use is only for
asserting and implicitly documenting the requirements we have on the
number passed to it.
2019-02-12 08:50:28 +01:00
..
c-list shared/c-list: re-import from latest c-util/c-list 2019-02-06 07:54:19 +01:00
c-rbtree shared/c-rbtree: minor change to make sources identical to upsteam 2019-02-06 08:19:51 +01:00
c-siphash shared/c-siphash: re-import from latest c-util/c-siphash 2019-02-06 08:27:07 +01:00
n-acd shared/n-acd: minor change to make sources identical to upsteam 2019-02-06 08:40:42 +01:00
nm-utils shared: cleanup separation and transition between errno and nmerr numbers 2019-02-12 08:50:28 +01:00
systemd systemd/trivial: adjust naming of include guard define 2019-02-12 08:50:28 +01:00
meson.build build/meson: add intermediate shared/nm-utils base library 2019-02-05 09:53:24 +01:00
nm-common-macros.h manager: add connectivity-check-{available,enabled} properties. 2017-08-17 22:31:47 +02:00
nm-dbus-compat.h build: rename directory "include" to "shared" 2015-12-24 11:42:37 +01:00
nm-default.h systemd: move basic systemd library to shared/nm-utils 2019-01-02 17:07:13 +01:00
nm-dispatcher-api.h build: cleanup src/Makefile.am 2016-08-11 11:54:18 +02:00
nm-ethtool-utils.c shared: fix static array declaration for _by_name in "nm-ethtool-utils.c" 2019-02-08 20:14:50 +01:00
nm-ethtool-utils.h all/ethtool: add support for all currently supported kernel features 2018-08-10 10:38:19 +02:00
nm-meta-setting.c wifi-p2p: rename Wi-Fi P2P 2019-02-01 17:02:57 +01:00
nm-meta-setting.h wifi-p2p: rename Wi-Fi P2P 2019-02-01 17:02:57 +01:00
nm-test-libnm-utils.h tests: add nmtstc_auto_service_cleanup macro 2018-06-25 12:13:28 +02:00
nm-test-utils-impl.c all: drop unnecessary includes of <errno.h> and <string.h> 2019-02-12 08:50:28 +01:00
nm-version-macros.h.in release: bump version to 1.15.0 (development) 2018-09-08 10:24:20 +02:00