#include "sd-daemon.h"
#include "alloc-util.h"
+#include "errno-util.h"
#include "escape.h"
#include "fd-util.h"
#include "log.h"
#include <unistd.h>
#include "async.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "log.h"
#include "macro.h"
--- /dev/null
+/* SPDX-License-Identifier: LGPL-2.1+ */
+#pragma once
+
+#include "macro.h"
+
+static inline void _reset_errno_(int *saved_errno) {
+ if (*saved_errno < 0) /* Invalidated by UNPROTECT_ERRNO? */
+ return;
+
+ errno = *saved_errno;
+}
+
+#define PROTECT_ERRNO \
+ _cleanup_(_reset_errno_) _unused_ int _saved_errno_ = errno
+
+#define UNPROTECT_ERRNO \
+ do { \
+ errno = _saved_errno_; \
+ _saved_errno_ = -1; \
+ } while (false)
+
+static inline int negative_errno(void) {
+ /* This helper should be used to shut up gcc if you know 'errno' is
+ * negative. Instead of "return -errno;", use "return negative_errno();"
+ * It will suppress bogus gcc warnings in case it assumes 'errno' might
+ * be 0 and thus the caller's error-handling might not be triggered. */
+ assert_return(errno > 0, -EINVAL);
+ return -errno;
+}
#include <sys/types.h>
#include <unistd.h>
+#include "errno-util.h"
#include "time-util.h"
-#include "util.h"
int unlink_noerrno(const char *path);
#include "sd-messages.h"
#include "alloc-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "format-util.h"
#include "io-util.h"
#include "terminal-util.h"
#include "time-util.h"
#include "utf8.h"
-#include "util.h"
#define SNDBUF_SIZE (8*1024*1024)
env-util.h
errno-list.c
errno-list.h
+ errno-util.h
escape.c
escape.h
ether-addr-util.c
#include <sys/stat.h>
-#include "util.h"
+#include "errno-util.h"
typedef enum RemoveFlags {
REMOVE_ONLY_DIRECTORIES = 1 << 0,
#endif
#include "alloc-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "log.h"
#include "macro.h"
#include "selinux-util.h"
#include "stdio-util.h"
#include "time-util.h"
-#include "util.h"
#if HAVE_SELINUX
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, freecon);
int on_ac_power(void);
-static inline void _reset_errno_(int *saved_errno) {
- if (*saved_errno < 0) /* Invalidated by UNPROTECT_ERRNO? */
- return;
-
- errno = *saved_errno;
-}
-
-#define PROTECT_ERRNO \
- _cleanup_(_reset_errno_) _unused_ int _saved_errno_ = errno
-
-#define UNPROTECT_ERRNO \
- do { \
- errno = _saved_errno_; \
- _saved_errno_ = -1; \
- } while (false)
-
-static inline int negative_errno(void) {
- /* This helper should be used to shut up gcc if you know 'errno' is
- * negative. Instead of "return -errno;", use "return negative_errno();"
- * It will suppress bogus gcc warnings in case it assumes 'errno' might
- * be 0 and thus the caller's error-handling might not be triggered. */
- assert_return(errno > 0, -EINVAL);
- return -errno;
-}
-
static inline unsigned u64log2(uint64_t n) {
#if __SIZEOF_LONG_LONG__ == 8
return (n > 1) ? (unsigned) __builtin_clzll(n) ^ 63U : 0;
#include "sd-journal.h"
#include "alloc-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "io-util.h"
#include "memfd-util.h"
#include "stdio-util.h"
#include "string-util.h"
#include "tmpfile-util.h"
-#include "util.h"
#define SNDBUF_SIZE (8*1024*1024)
#include <sys/mman.h>
#include "alloc-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "hashmap.h"
#include "list.h"
#include "alloc-util.h"
#include "bus-error.h"
#include "errno-list.h"
+#include "errno-util.h"
#include "string-util.h"
#include "util.h"
#include "alloc-util.h"
#include "dns-domain.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "io-util.h"
#include "list.h"
#include <string.h>
#include "alloc-util.h"
+#include "errno-util.h"
#include "hostname-util.h"
#include "local-addresses.h"
#include "macro.h"
#include "nss-util.h"
#include "signal-util.h"
#include "string-util.h"
-#include "util.h"
/* We use 127.0.0.2 as IPv4 address. This has the advantage over
* 127.0.0.1 that it can be translated back to the local hostname. For
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "env-util.h"
+#include "errno-util.h"
#include "hostname-util.h"
#include "in-addr-util.h"
#include "macro.h"
#include "sd-bus.h"
#include "bus-common-errors.h"
+#include "errno-util.h"
#include "in-addr-util.h"
#include "macro.h"
#include "nss-util.h"
#include "resolved-def.h"
-#include "string-util.h"
-#include "util.h"
#include "signal-util.h"
+#include "string-util.h"
NSS_GETHOSTBYNAME_PROTOTYPES(resolve);
NSS_GETHOSTBYADDR_PROTOTYPES(resolve);
#include "alloc-util.h"
#include "calendarspec.h"
+#include "errno-util.h"
#include "fileio.h"
#include "macro.h"
#include "parse-util.h"
#include "alloc-util.h"
#include "clock-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "macro.h"
#include "string-util.h"
-#include "util.h"
int clock_get_hwclock(struct tm *tm) {
_cleanup_close_ int fd = -1;
#include "sd-messages.h"
#include "alloc-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "float.h"
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <sys/xattr.h>
+#include <unistd.h>
#include "alloc-util.h"
#include "chown-recursive.h"