Merge pull request #12939 from yuwata/lgtm-fixes

make LGTM quiet
This commit is contained in:
Lennart Poettering
2019-07-10 14:57:14 +02:00
committed by GitHub
25 changed files with 102 additions and 68 deletions
+8
View File
@@ -1,6 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include <stdlib.h>
#include <string.h>
#include "macro.h"
static inline void _reset_errno_(int *saved_errno) {
@@ -28,6 +31,11 @@ static inline int negative_errno(void) {
return -errno;
}
static inline char *strerror_safe(int error) {
/* 'safe' here does NOT mean thread safety. */
return strerror(abs(error));
}
/* Hint #1: ENETUNREACH happens if we try to connect to "non-existing" special IP addresses, such as ::5.
*
* Hint #2: The kernel sends e.g., EHOSTUNREACH or ENONET to userspace in some ICMP error cases. See the