Move error.h to 'src/common/'
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 6 Apr 2021 23:36:31 +0000 (19:36 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 13 Apr 2021 18:52:48 +0000 (14:52 -0400)
Also rename it to 'err-ptr.h' to mitigate the risk of confusion with the
system header <error.h>.

Change-Id: Id86c8fda833c6358326708ccf54d5c35a69d5890
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/common/Makefile.am
src/common/err-ptr.h [new file with mode: 0644]
src/lib/lttng-ust/Makefile.am
src/lib/lttng-ust/error.h [deleted file]
src/lib/lttng-ust/getcpu.c
src/lib/lttng-ust/lttng-clock.c
src/lib/lttng-ust/lttng-events.c
src/lib/lttng-ust/lttng-probes.c
src/lib/lttng-ust/tracepoint.c

index ff2cfd71bfa6e47dda5f101eac972d5310dfb8a4..209364d01736bd175fe959ab21b4a8bc51168609 100644 (file)
@@ -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/common/err-ptr.h b/src/common/err-ptr.h
new file mode 100644 (file)
index 0000000..3e3f1da
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#ifndef _UST_COMMON_ERR_PTR_H
+#define _UST_COMMON_ERR_PTR_H
+
+#include <urcu/compiler.h>
+#include <unistd.h>
+
+#define MAX_ERRNO      4095
+
+static inline
+int IS_ERR_VALUE(long value)
+{
+       if (caa_unlikely((unsigned long) value >= (unsigned long) -MAX_ERRNO))
+               return 1;
+       else
+               return 0;
+}
+
+static inline
+void *ERR_PTR(long error)
+{
+       return (void *) error;
+}
+
+static inline
+long PTR_ERR(const void *ptr)
+{
+       return (long) ptr;
+}
+
+static inline
+int IS_ERR(const void *ptr)
+{
+       return IS_ERR_VALUE((long) ptr);
+}
+
+#endif /* _UST_COMMON_ERR_PTR_H */
index 1d0e85f153b16e8d35b0767f8ca116839b849b7c..aafcbd5f89775497635f78029cb087674f17b29e 100644 (file)
@@ -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/error.h b/src/lib/lttng-ust/error.h
deleted file mode 100644 (file)
index 1c39d7d..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * SPDX-License-Identifier: LGPL-2.1-only
- *
- * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _LTTNG_ERROR_H
-#define _LTTNG_ERROR_H
-
-#include <urcu/compiler.h>
-#include <unistd.h>
-
-#define MAX_ERRNO      4095
-
-static inline
-int IS_ERR_VALUE(long value)
-{
-       if (caa_unlikely((unsigned long) value >= (unsigned long) -MAX_ERRNO))
-               return 1;
-       else
-               return 0;
-}
-
-static inline
-void *ERR_PTR(long error)
-{
-       return (void *) error;
-}
-
-static inline
-long PTR_ERR(const void *ptr)
-{
-       return (long) ptr;
-}
-
-static inline
-int IS_ERR(const void *ptr)
-{
-       return IS_ERR_VALUE((long) ptr);
-}
-
-#endif /* _LTTNG_ERROR_H */
index 1fb7b16918c06dabbb0fbe37fa82001ac467dee9..149491cef2c666bbb567e225d58e0120d7774df0 100644 (file)
@@ -5,7 +5,6 @@
  */
 
 #define _LGPL_SOURCE
-#include <error.h>
 #include <dlfcn.h>
 #include <stdlib.h>
 #include "common/logging.h"
index 61b8e55a5db69848db78a52f034c34200119076e..bc38850ef00c8c2b9890a67fd52a331afdf18029 100644 (file)
@@ -5,7 +5,6 @@
  */
 
 #define _LGPL_SOURCE
-#include <error.h>
 #include <dlfcn.h>
 #include <stdlib.h>
 #include <stdint.h>
index 9ebd61dd4d7e11ae2edaedd6423058f0402b4bc6..b33d6e1bfa4ea0c45101f0389d0b32e0a488f845 100644 (file)
@@ -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"
index b2e77e01247b517cecc131eea718a5b142e7a7d0..7781811bef2f348a301de02daf2a40c32dbfa5b1 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "lttng-tracer-core.h"
 #include "common/jhash.h"
-#include "error.h"
 #include "lib/lttng-ust/events.h"
 
 /*
index e7f520abf34300b6bc3dce409f8f665ea80ada87..8d89d144f773a9597b45709e010f0bc655713ab8 100644 (file)
@@ -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")));
This page took 0.029752 seconds and 4 git commands to generate.