Files
NetworkManager/shared
Thomas Haller b216abb012 shared,all: return boolean success from nm_utils_file_get_contents()
... and nm_utils_fd_get_contents() and nm_utils_file_set_contents().

Don't mix negative errno return value with a GError output. Instead,
return a boolean result indicating success or failure.

Also, optionally

  - output GError

  - set out_errsv to the positive errno (or 0 on success)

Obviously, the return value and the output arguments (contents, length,
out_errsv, error) must all agree in their success/failure result.
That means, you may check any of the return value, out_errsv, error, and
contents to reliably detect failure or success.

Also note that out_errsv gives the positive(!) errno. But you probably
shouldn't care about the distinction and use nm_errno_native() either
way to normalize the value.
2019-08-08 11:59:59 +02:00
..
2019-04-14 17:22:04 +02:00
2019-04-14 17:23:01 +02:00
2019-04-14 17:23:25 +02:00