Move liblttng-ust-fd to 'src/lib/'
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 9 Apr 2021 18:22:45 +0000 (14:22 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 13 Apr 2021 18:06:18 +0000 (14:06 -0400)
Move all public libraries under 'src/lib/'.

This is part of an effort to standardize our autotools setup across
projects to simplify maintenance.

Change-Id: I11fffd79c7f74ab602b115be94dfa28937e6ff2d
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
.gitignore
configure.ac
src/Makefile.am
src/lib/Makefile.am
src/lib/lttng-ust-fd/Makefile.am [new file with mode: 0644]
src/lib/lttng-ust-fd/lttng-ust-fd.c [new file with mode: 0644]
src/liblttng-ust-fd/Makefile.am [deleted file]
src/liblttng-ust-fd/lttng-ust-fd.c [deleted file]

index 714646dd1a26bdf7dbe6c427e23845192b81515a..098b2277aaf9b2b7b6129ef26e405cb25956cdb8 100644 (file)
@@ -130,7 +130,7 @@ cscope.*
 /src/liblttng-ust-ctl/Makefile
 /src/lib/lttng-ust-cyg-profile/Makefile
 /src/liblttng-ust-dl/Makefile
-/src/liblttng-ust-fd/Makefile
+/src/lib/lttng-ust-fd/Makefile
 /src/lib/lttng-ust-fork/Makefile
 /src/liblttng-ust-java-agent/Makefile
 /src/liblttng-ust-java-agent/java/Makefile
index 7c2dd90262331933451bb788701dc31a423a8ee5..a75b323ee19e99cb369b7249e32343251bea11ae 100644 (file)
@@ -524,7 +524,7 @@ AC_CONFIG_FILES([
   src/liblttng-ust-ctl/Makefile
   src/lib/lttng-ust-cyg-profile/Makefile
   src/liblttng-ust-dl/Makefile
-  src/liblttng-ust-fd/Makefile
+  src/lib/lttng-ust-fd/Makefile
   src/lib/lttng-ust-fork/Makefile
   src/liblttng-ust-java-agent/java/lttng-ust-agent-all/Makefile
   src/liblttng-ust-java-agent/java/lttng-ust-agent-common/Makefile
index 33f9ed14deb42d3549d19087f08c5e41ede30f53..864808401e1c2d5b58e1dcf9d5d72ee8d6f01fa4 100644 (file)
@@ -7,8 +7,7 @@ SUBDIRS = \
        libcounter \
        liblttng-ust \
        liblttng-ust-ctl \
-       lib \
-       liblttng-ust-fd
+       lib
 
 if ENABLE_UST_DL
 SUBDIRS += liblttng-ust-dl
index bbaf9a01daead97ce7c92a710e96f850e77f714f..0803fc00c46227dc2cf297512d9cde7c1364ea3c 100644 (file)
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: LGPL-2.1-only
 
 SUBDIRS = \
+       lttng-ust-fd \
        lttng-ust-fork \
        lttng-ust-cyg-profile \
        lttng-ust-libc-wrapper
diff --git a/src/lib/lttng-ust-fd/Makefile.am b/src/lib/lttng-ust-fd/Makefile.am
new file mode 100644 (file)
index 0000000..6571b11
--- /dev/null
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: LGPL-2.1-only
+
+AM_CFLAGS += -fno-strict-aliasing
+
+lib_LTLIBRARIES = liblttng-ust-fd.la
+liblttng_ust_fd_la_SOURCES = \
+       lttng-ust-fd.c
+
+liblttng_ust_fd_la_LIBADD = \
+       $(top_builddir)/src/liblttng-ust/liblttng-ust.la \
+       $(DL_LIBS)
+
+liblttng_ust_fd_la_LDFLAGS = -version-info $(LTTNG_UST_LIBRARY_VERSION)
diff --git a/src/lib/lttng-ust-fd/lttng-ust-fd.c b/src/lib/lttng-ust-fd/lttng-ust-fd.c
new file mode 100644 (file)
index 0000000..5efc0ac
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2016  Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#define _LGPL_SOURCE
+#include <limits.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include "common/ust-fd.h"
+#include <dlfcn.h>
+
+#include "common/macros.h"
+
+static int (*__lttng_ust_fd_plibc_close)(int fd);
+static int (*__lttng_ust_fd_plibc_fclose)(FILE *stream);
+
+static
+int _lttng_ust_fd_libc_close(int fd)
+{
+       if (!__lttng_ust_fd_plibc_close) {
+               __lttng_ust_fd_plibc_close = dlsym(RTLD_NEXT, "close");
+               if (!__lttng_ust_fd_plibc_close) {
+                       fprintf(stderr, "%s\n", dlerror());
+                       return -1;
+               }
+       }
+       return lttng_ust_safe_close_fd(fd, __lttng_ust_fd_plibc_close);
+}
+
+static
+int _lttng_ust_fd_libc_fclose(FILE *stream)
+{
+       if (!__lttng_ust_fd_plibc_fclose) {
+               __lttng_ust_fd_plibc_fclose = dlsym(RTLD_NEXT, "fclose");
+               if (!__lttng_ust_fd_plibc_fclose) {
+                       fprintf(stderr, "%s\n", dlerror());
+                       return -1;
+               }
+       }
+       return lttng_ust_safe_fclose_stream(stream,
+                       __lttng_ust_fd_plibc_fclose);
+}
+
+int close(int fd)
+{
+       return _lttng_ust_fd_libc_close(fd);
+}
+
+/*
+ * Note: fcloseall() is not an issue because it fcloses only the
+ * streams it knows about, which differs from the problems caused by
+ * gnulib close_stdout(), which does an explicit fclose(stdout).
+ */
+int fclose(FILE *stream)
+{
+       return _lttng_ust_fd_libc_fclose(stream);
+}
+
+#if defined(__sun__) || defined(__FreeBSD__)
+/* Solaris and FreeBSD. */
+void closefrom(int lowfd)
+{
+       (void) lttng_ust_safe_closefrom_fd(lowfd, __lttng_ust_fd_plibc_close);
+}
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
+/* NetBSD and OpenBSD. */
+int closefrom(int lowfd)
+{
+       return lttng_ust_safe_closefrom_fd(lowfd, __lttng_ust_fd_plibc_close);
+}
+#else
+/* As far as we know, this OS does not implement closefrom. */
+#endif
diff --git a/src/liblttng-ust-fd/Makefile.am b/src/liblttng-ust-fd/Makefile.am
deleted file mode 100644 (file)
index 6571b11..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-only
-
-AM_CFLAGS += -fno-strict-aliasing
-
-lib_LTLIBRARIES = liblttng-ust-fd.la
-liblttng_ust_fd_la_SOURCES = \
-       lttng-ust-fd.c
-
-liblttng_ust_fd_la_LIBADD = \
-       $(top_builddir)/src/liblttng-ust/liblttng-ust.la \
-       $(DL_LIBS)
-
-liblttng_ust_fd_la_LDFLAGS = -version-info $(LTTNG_UST_LIBRARY_VERSION)
diff --git a/src/liblttng-ust-fd/lttng-ust-fd.c b/src/liblttng-ust-fd/lttng-ust-fd.c
deleted file mode 100644 (file)
index 5efc0ac..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * SPDX-License-Identifier: LGPL-2.1-only
- *
- * Copyright (C) 2016  Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#define _LGPL_SOURCE
-#include <limits.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include "common/ust-fd.h"
-#include <dlfcn.h>
-
-#include "common/macros.h"
-
-static int (*__lttng_ust_fd_plibc_close)(int fd);
-static int (*__lttng_ust_fd_plibc_fclose)(FILE *stream);
-
-static
-int _lttng_ust_fd_libc_close(int fd)
-{
-       if (!__lttng_ust_fd_plibc_close) {
-               __lttng_ust_fd_plibc_close = dlsym(RTLD_NEXT, "close");
-               if (!__lttng_ust_fd_plibc_close) {
-                       fprintf(stderr, "%s\n", dlerror());
-                       return -1;
-               }
-       }
-       return lttng_ust_safe_close_fd(fd, __lttng_ust_fd_plibc_close);
-}
-
-static
-int _lttng_ust_fd_libc_fclose(FILE *stream)
-{
-       if (!__lttng_ust_fd_plibc_fclose) {
-               __lttng_ust_fd_plibc_fclose = dlsym(RTLD_NEXT, "fclose");
-               if (!__lttng_ust_fd_plibc_fclose) {
-                       fprintf(stderr, "%s\n", dlerror());
-                       return -1;
-               }
-       }
-       return lttng_ust_safe_fclose_stream(stream,
-                       __lttng_ust_fd_plibc_fclose);
-}
-
-int close(int fd)
-{
-       return _lttng_ust_fd_libc_close(fd);
-}
-
-/*
- * Note: fcloseall() is not an issue because it fcloses only the
- * streams it knows about, which differs from the problems caused by
- * gnulib close_stdout(), which does an explicit fclose(stdout).
- */
-int fclose(FILE *stream)
-{
-       return _lttng_ust_fd_libc_fclose(stream);
-}
-
-#if defined(__sun__) || defined(__FreeBSD__)
-/* Solaris and FreeBSD. */
-void closefrom(int lowfd)
-{
-       (void) lttng_ust_safe_closefrom_fd(lowfd, __lttng_ust_fd_plibc_close);
-}
-#elif defined(__NetBSD__) || defined(__OpenBSD__)
-/* NetBSD and OpenBSD. */
-int closefrom(int lowfd)
-{
-       return lttng_ust_safe_closefrom_fd(lowfd, __lttng_ust_fd_plibc_close);
-}
-#else
-/* As far as we know, this OS does not implement closefrom. */
-#endif
This page took 0.069368 seconds and 4 git commands to generate.