From 9c4fe08d87975f3f79227b1b5e7629d52a16b4fc Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 6 Apr 2021 19:36:31 -0400 Subject: [PATCH] Move error.h to 'src/common/' Also rename it to 'err-ptr.h' to mitigate the risk of confusion with the system header . Change-Id: Id86c8fda833c6358326708ccf54d5c35a69d5890 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- src/common/Makefile.am | 1 + src/{lib/lttng-ust/error.h => common/err-ptr.h} | 6 +++--- src/lib/lttng-ust/Makefile.am | 4 +--- src/lib/lttng-ust/getcpu.c | 1 - src/lib/lttng-ust/lttng-clock.c | 1 - src/lib/lttng-ust/lttng-events.c | 1 - src/lib/lttng-ust/lttng-probes.c | 1 - src/lib/lttng-ust/tracepoint.c | 2 +- 8 files changed, 6 insertions(+), 11 deletions(-) rename src/{lib/lttng-ust/error.h => common/err-ptr.h} (85%) diff --git a/src/common/Makefile.am b/src/common/Makefile.am index ff2cfd71..209364d0 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -14,6 +14,7 @@ noinst_HEADERS = \ creds.h \ dynamic-type.h \ elf.h \ + err-ptr.h \ events.h \ jhash.h \ logging.h \ diff --git a/src/lib/lttng-ust/error.h b/src/common/err-ptr.h similarity index 85% rename from src/lib/lttng-ust/error.h rename to src/common/err-ptr.h index 1c39d7db..3e3f1da1 100644 --- a/src/lib/lttng-ust/error.h +++ b/src/common/err-ptr.h @@ -4,8 +4,8 @@ * Copyright (C) 2011 Mathieu Desnoyers */ -#ifndef _LTTNG_ERROR_H -#define _LTTNG_ERROR_H +#ifndef _UST_COMMON_ERR_PTR_H +#define _UST_COMMON_ERR_PTR_H #include #include @@ -39,4 +39,4 @@ int IS_ERR(const void *ptr) return IS_ERR_VALUE((long) ptr); } -#endif /* _LTTNG_ERROR_H */ +#endif /* _UST_COMMON_ERR_PTR_H */ diff --git a/src/lib/lttng-ust/Makefile.am b/src/lib/lttng-ust/Makefile.am index 1d0e85f1..aafcbd5f 100644 --- a/src/lib/lttng-ust/Makefile.am +++ b/src/lib/lttng-ust/Makefile.am @@ -22,8 +22,7 @@ liblttng_ust_tracepoint_la_SOURCES = \ tracepoint.c \ tracepoint-weak-test.c \ tracepoint-internal.h \ - lttng-tracer-core.h \ - error.h + lttng-tracer-core.h liblttng_ust_tracepoint_la_LIBADD = \ liblttng-ust-common.la \ @@ -80,7 +79,6 @@ liblttng_ust_runtime_la_SOURCES = \ events.h \ clock.h \ lttng-ust-uuid.h \ - error.h \ tracef.c \ lttng-ust-tracef-provider.h \ tracelog.c \ diff --git a/src/lib/lttng-ust/getcpu.c b/src/lib/lttng-ust/getcpu.c index 1fb7b169..149491ce 100644 --- a/src/lib/lttng-ust/getcpu.c +++ b/src/lib/lttng-ust/getcpu.c @@ -5,7 +5,6 @@ */ #define _LGPL_SOURCE -#include #include #include #include "common/logging.h" diff --git a/src/lib/lttng-ust/lttng-clock.c b/src/lib/lttng-ust/lttng-clock.c index 61b8e55a..bc38850e 100644 --- a/src/lib/lttng-ust/lttng-clock.c +++ b/src/lib/lttng-ust/lttng-clock.c @@ -5,7 +5,6 @@ */ #define _LGPL_SOURCE -#include #include #include #include diff --git a/src/lib/lttng-ust/lttng-events.c b/src/lib/lttng-ust/lttng-events.c index 9ebd61dd..b33d6e1b 100644 --- a/src/lib/lttng-ust/lttng-events.c +++ b/src/lib/lttng-ust/lttng-events.c @@ -39,7 +39,6 @@ #include "common/ust-fd.h" #include "common/dynamic-type.h" #include "common/ust-context-provider.h" -#include "error.h" #include "lttng-ust-uuid.h" #include "tracepoint-internal.h" diff --git a/src/lib/lttng-ust/lttng-probes.c b/src/lib/lttng-ust/lttng-probes.c index b2e77e01..7781811b 100644 --- a/src/lib/lttng-ust/lttng-probes.c +++ b/src/lib/lttng-ust/lttng-probes.c @@ -20,7 +20,6 @@ #include "lttng-tracer-core.h" #include "common/jhash.h" -#include "error.h" #include "lib/lttng-ust/events.h" /* diff --git a/src/lib/lttng-ust/tracepoint.c b/src/lib/lttng-ust/tracepoint.c index e7f520ab..8d89d144 100644 --- a/src/lib/lttng-ust/tracepoint.c +++ b/src/lib/lttng-ust/tracepoint.c @@ -29,7 +29,7 @@ #include "tracepoint-internal.h" #include "lttng-tracer-core.h" #include "common/jhash.h" -#include "error.h" +#include "common/err-ptr.h" /* Test compiler support for weak symbols with hidden visibility. */ int __tracepoint_test_symbol1 __attribute__((weak, visibility("hidden"))); -- 2.34.1