From edf4b93e2f5c849cbec49e987990b3705ea49f6a Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 13 Oct 2020 17:33:44 -0400 Subject: [PATCH] port: FreeBSD has no ENODATA, alias it to ENOATTR MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit According to 'the internet' ENOATTR is used in a similar fashion to ENODATA on the BSDs and we used it internally only anyway. Change-Id: Ia4e77fd6d28c9dfb43f99ddba6c32369384827f0 Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/event.c | 2 +- src/bin/lttng-sessiond/fd-limit.c | 2 +- src/bin/lttng-sessiond/sessiond-config.c | 2 +- src/bin/lttng-sessiond/ust-app.c | 2 +- src/bin/lttng-sessiond/ust-consumer.c | 2 +- src/bin/lttng/conf.c | 2 +- src/common/compat/Makefile.am | 3 ++- src/common/compat/errno.h | 18 ++++++++++++++++++ src/common/compat/fcntl.h | 3 ++- src/common/compat/pthread.h | 2 +- src/common/compat/socket.h | 2 +- src/common/compat/time.h | 2 +- src/common/error.c | 2 +- src/common/error.h | 2 +- src/common/filter/filter-grammar-test.c | 4 +++- src/common/filter/filter-parser.y | 2 +- .../filter/filter-visitor-generate-bytecode.c | 2 +- src/common/filter/filter-visitor-generate-ir.c | 2 +- ...filter-visitor-ir-check-binary-comparator.c | 4 +++- ...filter-visitor-ir-check-binary-op-nesting.c | 2 +- ...filter-visitor-ir-normalize-glob-patterns.c | 2 +- .../filter-visitor-ir-validate-globbing.c | 2 +- .../filter/filter-visitor-ir-validate-string.c | 2 +- src/common/filter/filter-visitor-xml.c | 2 +- src/common/kernel-ctl/kernel-ctl.c | 2 +- src/common/readwrite.c | 3 ++- src/common/runas.c | 2 +- src/common/sessiond-comm/inet.c | 2 +- src/common/sessiond-comm/inet6.c | 2 +- src/common/sessiond-comm/sessiond-comm.c | 2 +- src/common/spawn-viewer.c | 2 +- src/common/time.c | 2 +- src/common/unix.c | 2 +- src/common/ust-consumer/ust-consumer.h | 3 +-- src/lib/lttng-ctl/lttng-ctl-health.c | 2 +- src/lib/lttng-ctl/lttng-ctl.c | 2 +- tests/regression/tools/live/live_test.c | 2 +- .../tools/notification/notification.c | 2 +- tests/regression/ust/ust-dl/prog.c | 3 ++- tests/unit/test_directory_handle.c | 2 +- tests/unit/test_fd_tracker.c | 2 +- tests/unit/test_kernel_data.c | 2 +- tests/unit/test_session.c | 2 +- tests/unit/test_ust_data.c | 2 +- tests/utils/utils.c | 3 ++- 45 files changed, 71 insertions(+), 45 deletions(-) create mode 100644 src/common/compat/errno.h diff --git a/src/bin/lttng-sessiond/event.c b/src/bin/lttng-sessiond/event.c index 189236beb..d8abc60f5 100644 --- a/src/bin/lttng-sessiond/event.c +++ b/src/bin/lttng-sessiond/event.c @@ -7,10 +7,10 @@ */ #define _LGPL_SOURCE -#include #include #include +#include #include #include #include diff --git a/src/bin/lttng-sessiond/fd-limit.c b/src/bin/lttng-sessiond/fd-limit.c index 626b4662c..973f7d74a 100644 --- a/src/bin/lttng-sessiond/fd-limit.c +++ b/src/bin/lttng-sessiond/fd-limit.c @@ -9,10 +9,10 @@ #include #include #include -#include #include #include "fd-limit.h" #include +#include /* total count of fd. */ static long fd_count; diff --git a/src/bin/lttng-sessiond/sessiond-config.c b/src/bin/lttng-sessiond/sessiond-config.c index f0ab4ce04..c7a918307 100644 --- a/src/bin/lttng-sessiond/sessiond-config.c +++ b/src/bin/lttng-sessiond/sessiond-config.c @@ -11,10 +11,10 @@ #include "lttng-ust-ctl.h" #include #include -#include #include #include #include +#include #include static diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 1f2d4238e..28313cb93 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -7,7 +7,6 @@ */ #define _LGPL_SOURCE -#include #include #include #include @@ -19,6 +18,7 @@ #include #include +#include #include #include diff --git a/src/bin/lttng-sessiond/ust-consumer.c b/src/bin/lttng-sessiond/ust-consumer.c index 70e3d1658..cd6b53ee1 100644 --- a/src/bin/lttng-sessiond/ust-consumer.c +++ b/src/bin/lttng-sessiond/ust-consumer.c @@ -6,13 +6,13 @@ */ #define _LGPL_SOURCE -#include #include #include #include #include #include +#include #include #include #include diff --git a/src/bin/lttng/conf.c b/src/bin/lttng/conf.c index 8e703b058..4079d6ed9 100644 --- a/src/bin/lttng/conf.c +++ b/src/bin/lttng/conf.c @@ -13,8 +13,8 @@ #include #include #include -#include +#include #include #include diff --git a/src/common/compat/Makefile.am b/src/common/compat/Makefile.am index 299a956b9..a8f2c1001 100644 --- a/src/common/compat/Makefile.am +++ b/src/common/compat/Makefile.am @@ -5,4 +5,5 @@ noinst_LTLIBRARIES = libcompat.la libcompat_la_SOURCES = poll.c poll.h fcntl.h endian.h mman.h dirent.h \ socket.h compat-fcntl.c tid.h \ getenv.h string.h paths.h pthread.h netdb.h \ - time.h directory-handle.h directory-handle.c path.h + time.h directory-handle.h directory-handle.c path.h \ + errno.h diff --git a/src/common/compat/errno.h b/src/common/compat/errno.h new file mode 100644 index 000000000..18cb847e5 --- /dev/null +++ b/src/common/compat/errno.h @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2020 Michael Jeanson + * + * SPDX-License-Identifier: GPL-2.0-only + * + */ + +#ifndef _COMPAT_ERRNO_H +#define _COMPAT_ERRNO_H + +#include + +/* Missing on FreeBSD */ +#ifndef ENODATA +#define ENODATA ENOATTR +#endif + +#endif /* _COMPAT_ERRNO_H */ diff --git a/src/common/compat/fcntl.h b/src/common/compat/fcntl.h index ef97bf9da..b18e2f4e7 100644 --- a/src/common/compat/fcntl.h +++ b/src/common/compat/fcntl.h @@ -9,9 +9,10 @@ #define _COMPAT_FCNTL_H #include -#include #include +#include + #if (defined(__CYGWIN__)) typedef long long off64_t; #endif diff --git a/src/common/compat/pthread.h b/src/common/compat/pthread.h index 4d3f9c772..87aa746ba 100644 --- a/src/common/compat/pthread.h +++ b/src/common/compat/pthread.h @@ -9,7 +9,7 @@ #define _COMPAT_PTHREAD_H #include -#include +#include #if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) static inline diff --git a/src/common/compat/socket.h b/src/common/compat/socket.h index 3690ba679..a510473c3 100644 --- a/src/common/compat/socket.h +++ b/src/common/compat/socket.h @@ -28,7 +28,7 @@ ssize_t lttng_recvmsg_nosigpipe(int sockfd, struct msghdr *msg) #else #include -#include +#include static inline ssize_t lttng_recvmsg_nosigpipe(int sockfd, struct msghdr *msg) diff --git a/src/common/compat/time.h b/src/common/compat/time.h index eb67d39ec..72a9afff4 100644 --- a/src/common/compat/time.h +++ b/src/common/compat/time.h @@ -16,7 +16,7 @@ typedef uint64_t timer_t; #include #include -#include +#include #undef NSEC_PER_SEC #undef NSEC_PER_MSEC diff --git a/src/common/error.c b/src/common/error.c index 11dbc9028..7ededdb73 100644 --- a/src/common/error.c +++ b/src/common/error.c @@ -7,7 +7,6 @@ #define _LGPL_SOURCE #include -#include #include #include #include @@ -15,6 +14,7 @@ #include #include +#include #include #include diff --git a/src/common/error.h b/src/common/error.h index ea00ea5f9..c4aa4012a 100644 --- a/src/common/error.h +++ b/src/common/error.h @@ -8,7 +8,7 @@ #ifndef _ERROR_H #define _ERROR_H -#include +#include #include #include #include diff --git a/src/common/filter/filter-grammar-test.c b/src/common/filter/filter-grammar-test.c index 70656e1a8..ba888aec3 100644 --- a/src/common/filter/filter-grammar-test.c +++ b/src/common/filter/filter-grammar-test.c @@ -14,8 +14,10 @@ #include #include #include -#include #include + +#include + #include "filter-ast.h" #include "filter-parser.h" #include "filter-bytecode.h" diff --git a/src/common/filter/filter-parser.y b/src/common/filter/filter-parser.y index 245d83c26..e52f04eb3 100644 --- a/src/common/filter/filter-parser.y +++ b/src/common/filter/filter-parser.y @@ -16,13 +16,13 @@ #include #include #include -#include #include #include "filter-ast.h" #include "filter-parser.h" #include "filter-bytecode.h" #include "memstream.h" +#include #include #define WIDTH_u64_SCANF_IS_A_BROKEN_API "20" diff --git a/src/common/filter/filter-visitor-generate-bytecode.c b/src/common/filter/filter-visitor-generate-bytecode.c index 699273c3d..ce35cec6e 100644 --- a/src/common/filter/filter-visitor-generate-bytecode.c +++ b/src/common/filter/filter-visitor-generate-bytecode.c @@ -11,8 +11,8 @@ #include #include -#include #include +#include #include #include "filter-bytecode.h" diff --git a/src/common/filter/filter-visitor-generate-ir.c b/src/common/filter/filter-visitor-generate-ir.c index 11c6b610c..b7bc17d18 100644 --- a/src/common/filter/filter-visitor-generate-ir.c +++ b/src/common/filter/filter-visitor-generate-ir.c @@ -14,12 +14,12 @@ #include #include #include -#include #include #include "filter-ast.h" #include "filter-parser.h" #include "filter-ir.h" +#include #include #include diff --git a/src/common/filter/filter-visitor-ir-check-binary-comparator.c b/src/common/filter/filter-visitor-ir-check-binary-comparator.c index bcbb69e3f..ae61ae96b 100644 --- a/src/common/filter/filter-visitor-ir-check-binary-comparator.c +++ b/src/common/filter/filter-visitor-ir-check-binary-comparator.c @@ -14,8 +14,10 @@ #include #include #include -#include #include + +#include + #include "filter-ast.h" #include "filter-parser.h" #include "filter-ir.h" diff --git a/src/common/filter/filter-visitor-ir-check-binary-op-nesting.c b/src/common/filter/filter-visitor-ir-check-binary-op-nesting.c index 04a5fbdd6..9c259f776 100644 --- a/src/common/filter/filter-visitor-ir-check-binary-op-nesting.c +++ b/src/common/filter/filter-visitor-ir-check-binary-op-nesting.c @@ -14,12 +14,12 @@ #include #include #include -#include #include #include "filter-ast.h" #include "filter-parser.h" #include "filter-ir.h" +#include #include static diff --git a/src/common/filter/filter-visitor-ir-normalize-glob-patterns.c b/src/common/filter/filter-visitor-ir-normalize-glob-patterns.c index 5e2778e09..d6a9132d3 100644 --- a/src/common/filter/filter-visitor-ir-normalize-glob-patterns.c +++ b/src/common/filter/filter-visitor-ir-normalize-glob-patterns.c @@ -14,9 +14,9 @@ #include #include #include -#include #include +#include #include #include diff --git a/src/common/filter/filter-visitor-ir-validate-globbing.c b/src/common/filter/filter-visitor-ir-validate-globbing.c index 3e749a4da..db64cbdf5 100644 --- a/src/common/filter/filter-visitor-ir-validate-globbing.c +++ b/src/common/filter/filter-visitor-ir-validate-globbing.c @@ -14,9 +14,9 @@ #include #include #include -#include #include +#include #include #include "filter-ast.h" diff --git a/src/common/filter/filter-visitor-ir-validate-string.c b/src/common/filter/filter-visitor-ir-validate-string.c index 1df83b03f..b62fbc438 100644 --- a/src/common/filter/filter-visitor-ir-validate-string.c +++ b/src/common/filter/filter-visitor-ir-validate-string.c @@ -14,10 +14,10 @@ #include #include #include -#include #include #include +#include #include "filter-ast.h" #include "filter-parser.h" diff --git a/src/common/filter/filter-visitor-xml.c b/src/common/filter/filter-visitor-xml.c index d5ff0c187..a5aba193b 100644 --- a/src/common/filter/filter-visitor-xml.c +++ b/src/common/filter/filter-visitor-xml.c @@ -14,11 +14,11 @@ #include #include #include -#include #include #include "filter-ast.h" #include "filter-parser.h" +#include #include #define fprintf_dbg(fd, fmt, args...) fprintf(fd, "%s: " fmt, __func__, ## args) diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index 10e281d69..4470e7717 100644 --- a/src/common/kernel-ctl/kernel-ctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/common/readwrite.c b/src/common/readwrite.c index 9ec2cb0e5..6019aa2dc 100644 --- a/src/common/readwrite.c +++ b/src/common/readwrite.c @@ -7,10 +7,11 @@ #define _LGPL_SOURCE #include -#include #include #include +#include + #include "readwrite.h" /* diff --git a/src/common/runas.c b/src/common/runas.c index 3c4c2ae0b..30bf4263a 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -8,7 +8,6 @@ */ #define _LGPL_SOURCE -#include #include #include #include @@ -26,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/src/common/sessiond-comm/inet.c b/src/common/sessiond-comm/inet.c index aff451e75..827b97598 100644 --- a/src/common/sessiond-comm/inet.c +++ b/src/common/sessiond-comm/inet.c @@ -14,13 +14,13 @@ #include #include #include -#include #include #include #include #include #include +#include #include "inet.h" diff --git a/src/common/sessiond-comm/inet6.c b/src/common/sessiond-comm/inet6.c index c33e39f7b..40610ed57 100644 --- a/src/common/sessiond-comm/inet6.c +++ b/src/common/sessiond-comm/inet6.c @@ -14,13 +14,13 @@ #include #include #include -#include #include #include #include #include #include +#include #include "inet6.h" diff --git a/src/common/sessiond-comm/sessiond-comm.c b/src/common/sessiond-comm/sessiond-comm.c index 9f00ae181..6c00a71bc 100644 --- a/src/common/sessiond-comm/sessiond-comm.c +++ b/src/common/sessiond-comm/sessiond-comm.c @@ -15,10 +15,10 @@ #include #include #include -#include #include #include +#include #include "sessiond-comm.h" diff --git a/src/common/spawn-viewer.c b/src/common/spawn-viewer.c index 26fe9199f..781886503 100644 --- a/src/common/spawn-viewer.c +++ b/src/common/spawn-viewer.c @@ -12,10 +12,10 @@ #include #include #include -#include #include +#include #include "error.h" #include "macros.h" #include "spawn-viewer.h" diff --git a/src/common/time.c b/src/common/time.c index d084a3fdd..90ce4d4b6 100644 --- a/src/common/time.c +++ b/src/common/time.c @@ -9,10 +9,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff --git a/src/common/unix.c b/src/common/unix.c index 205334325..0e6c329c0 100644 --- a/src/common/unix.c +++ b/src/common/unix.c @@ -15,9 +15,9 @@ #include #include #include -#include #include +#include #include #include diff --git a/src/common/ust-consumer/ust-consumer.h b/src/common/ust-consumer/ust-consumer.h index 5059f5b95..bd3233700 100644 --- a/src/common/ust-consumer/ust-consumer.h +++ b/src/common/ust-consumer/ust-consumer.h @@ -9,8 +9,7 @@ #ifndef _LTTNG_USTCONSUMER_H #define _LTTNG_USTCONSUMER_H -#include - +#include #include #include diff --git a/src/lib/lttng-ctl/lttng-ctl-health.c b/src/lib/lttng-ctl/lttng-ctl-health.c index 91108c166..9ae3d4174 100644 --- a/src/lib/lttng-ctl/lttng-ctl-health.c +++ b/src/lib/lttng-ctl/lttng-ctl-health.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include @@ -24,6 +23,7 @@ #include #include #include +#include #include "lttng-ctl-helper.h" diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 3f1ab9fdc..60e820bd2 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -13,13 +13,13 @@ #define _LGPL_SOURCE #include #include -#include #include #include #include #include #include +#include #include #include #include diff --git a/tests/regression/tools/live/live_test.c b/tests/regression/tools/live/live_test.c index bfbd842c0..4c56deece 100644 --- a/tests/regression/tools/live/live_test.c +++ b/tests/regression/tools/live/live_test.c @@ -6,7 +6,6 @@ */ #include -#include #include #include #include @@ -31,6 +30,7 @@ #include #include +#include #include #define SESSION1 "test1" diff --git a/tests/regression/tools/notification/notification.c b/tests/regression/tools/notification/notification.c index 364d41895..90abc11de 100644 --- a/tests/regression/tools/notification/notification.c +++ b/tests/regression/tools/notification/notification.c @@ -21,9 +21,9 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/tests/regression/ust/ust-dl/prog.c b/tests/regression/ust/ust-dl/prog.c index fb4e5c0e1..473de57a9 100644 --- a/tests/regression/ust/ust-dl/prog.c +++ b/tests/regression/ust/ust-dl/prog.c @@ -8,10 +8,11 @@ /* _GNU_SOURCE is defined by config.h */ #include #include -#include #include #include +#include + /* * libfoo has a direct dependency on libbar. * libbar has a direct dependency on libzzz. diff --git a/tests/unit/test_directory_handle.c b/tests/unit/test_directory_handle.c index a94c4df75..8bc59e081 100644 --- a/tests/unit/test_directory_handle.c +++ b/tests/unit/test_directory_handle.c @@ -6,7 +6,6 @@ */ #include -#include #include #include #include @@ -17,6 +16,7 @@ #include #include +#include #include #include diff --git a/tests/unit/test_fd_tracker.c b/tests/unit/test_fd_tracker.c index c4248ed81..29d50873b 100644 --- a/tests/unit/test_fd_tracker.c +++ b/tests/unit/test_fd_tracker.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -24,6 +23,7 @@ #include #include +#include #include #include diff --git a/tests/unit/test_kernel_data.c b/tests/unit/test_kernel_data.c index 4ce6f6c74..d575d2518 100644 --- a/tests/unit/test_kernel_data.c +++ b/tests/unit/test_kernel_data.c @@ -6,13 +6,13 @@ */ #include -#include #include #include #include #include #include +#include #include #include diff --git a/tests/unit/test_session.c b/tests/unit/test_session.c index 2103a8f46..676ea316e 100644 --- a/tests/unit/test_session.c +++ b/tests/unit/test_session.c @@ -6,7 +6,6 @@ */ #include -#include #include #include #include @@ -17,6 +16,7 @@ #include +#include #include #include #include diff --git a/tests/unit/test_ust_data.c b/tests/unit/test_ust_data.c index 7a0deaecc..ec61ffbad 100644 --- a/tests/unit/test_ust_data.c +++ b/tests/unit/test_ust_data.c @@ -6,7 +6,6 @@ */ #include -#include #include #include #include @@ -17,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/tests/utils/utils.c b/tests/utils/utils.c index 46ec61cd0..d54c6cc99 100644 --- a/tests/utils/utils.c +++ b/tests/utils/utils.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -19,6 +18,8 @@ #include #include +#include + #include "utils.h" static inline -- 2.34.1