* [gentoo-commits] proj/sandbox:master commit in: libsandbox/, libsbutil/
@ 2021-10-21 8:06 Mike Frysinger
0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2021-10-21 8:06 UTC (permalink / raw
To: gentoo-commits
commit: 17608a9e94643f79a50cccce6fe3274a7a3210bf
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 21 08:06:09 2021 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Oct 21 08:06:09 2021 +0000
URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=17608a9e
delete redundant headers.h stub
These dirs have -I paths to the top-level, so these redirects aren't
that useful anymore.
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
libsandbox/headers.h | 1 -
libsandbox/local.mk | 1 -
| 1 -
libsbutil/local.mk | 1 -
4 files changed, 4 deletions(-)
diff --git a/libsandbox/headers.h b/libsandbox/headers.h
deleted file mode 100644
index 7fcc3b2..0000000
--- a/libsandbox/headers.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../headers.h"
diff --git a/libsandbox/local.mk b/libsandbox/local.mk
index 9ddecb9..892121a 100644
--- a/libsandbox/local.mk
+++ b/libsandbox/local.mk
@@ -24,7 +24,6 @@ libsbutil/.libs/libsbutil.a: libsbutil/libsbutil.la
-avoid-version \
$(LDFLAG_VER),%D%/libsandbox.map
%C%_libsandbox_la_SOURCES = \
- %D%/headers.h \
%D%/libsandbox.h \
%D%/libsandbox.c \
%D%/lock.c \
diff --git a/libsbutil/headers.h b/libsbutil/headers.h
deleted file mode 100644
index 7fcc3b2..0000000
--- a/libsbutil/headers.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../headers.h"
diff --git a/libsbutil/local.mk b/libsbutil/local.mk
index d1a9ffd..0133751 100644
--- a/libsbutil/local.mk
+++ b/libsbutil/local.mk
@@ -15,7 +15,6 @@ noinst_LTLIBRARIES += %D%/libsbutil.la
%D%/get_sandbox_log.c \
%D%/get_tmp_dir.c \
%D%/environment.c \
- %D%/headers.h \
%D%/sb_backtrace.c \
%D%/sb_efuncs.c \
%D%/sb_gdb.c \
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] proj/sandbox:stable-2.x commit in: libsandbox/, libsbutil/
@ 2025-01-13 17:50 Mike Gilbert
2025-01-14 4:38 ` [gentoo-commits] proj/sandbox:master " Mike Gilbert
0 siblings, 1 reply; 5+ messages in thread
From: Mike Gilbert @ 2025-01-13 17:50 UTC (permalink / raw
To: gentoo-commits
commit: 51f279725662ceba90689bdde0b4b06c21eb9cc1
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 13 17:49:00 2025 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Jan 13 17:49:00 2025 +0000
URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=51f27972
Revert "libsandbox: simplify reference to libsbutil"
We really want to treat this more like a static lib rather than a
convenience lib, but libtool doesn't allow that.
Reverts: d9a4a0c97f4840e3c6b84fa6302ed511dd73705b
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
libsandbox/local.mk | 9 ++++++++-
libsbutil/sb_backtrace.c | 1 -
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/libsandbox/local.mk b/libsandbox/local.mk
index b3ccd39..d2fb1d1 100644
--- a/libsandbox/local.mk
+++ b/libsandbox/local.mk
@@ -9,7 +9,14 @@ lib_LTLIBRARIES += %D%/libsandbox.la
-I$(top_srcdir)/libsbutil/include
%C%_libsandbox_la_CFLAGS = $(CFLAG_EXCEPTIONS)
-%C%_libsandbox_la_LIBADD = libsbutil/libsbutil.la $(LIBDL)
+# Could use the following to libsandbox_la_LIBADD, but then libtool links it
+# with --whole-archive, and libsandbox.so increase with a few KB in size:
+# libsbutil/libsbutil.la
+libsbutil/.libs/libsbutil.a: libsbutil/libsbutil.la
+%C%_libsandbox_la_LIBSBLIB = libsbutil/.libs/libsbutil.a
+%C%_libsandbox_la_LIBADD = \
+ $(%C%_libsandbox_la_LIBSBLIB) \
+ $(LIBDL)
# Do not add -nostdlib or -nostartfiles, as then our constructor
# and destructor will not be executed ...
%C%_libsandbox_la_LDFLAGS = \
diff --git a/libsbutil/sb_backtrace.c b/libsbutil/sb_backtrace.c
index f06b781..e3d1ed7 100644
--- a/libsbutil/sb_backtrace.c
+++ b/libsbutil/sb_backtrace.c
@@ -10,7 +10,6 @@
#include "headers.h"
#include "sbutil.h"
-__attribute__((weak))
void __sb_dump_backtrace(void)
{
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] proj/sandbox:master commit in: libsandbox/, libsbutil/
2025-01-13 17:50 [gentoo-commits] proj/sandbox:stable-2.x commit in: libsandbox/, libsbutil/ Mike Gilbert
@ 2025-01-14 4:38 ` Mike Gilbert
0 siblings, 0 replies; 5+ messages in thread
From: Mike Gilbert @ 2025-01-14 4:38 UTC (permalink / raw
To: gentoo-commits
commit: 51f279725662ceba90689bdde0b4b06c21eb9cc1
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 13 17:49:00 2025 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Jan 13 17:49:00 2025 +0000
URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=51f27972
Revert "libsandbox: simplify reference to libsbutil"
We really want to treat this more like a static lib rather than a
convenience lib, but libtool doesn't allow that.
Reverts: d9a4a0c97f4840e3c6b84fa6302ed511dd73705b
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
libsandbox/local.mk | 9 ++++++++-
libsbutil/sb_backtrace.c | 1 -
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/libsandbox/local.mk b/libsandbox/local.mk
index b3ccd39..d2fb1d1 100644
--- a/libsandbox/local.mk
+++ b/libsandbox/local.mk
@@ -9,7 +9,14 @@ lib_LTLIBRARIES += %D%/libsandbox.la
-I$(top_srcdir)/libsbutil/include
%C%_libsandbox_la_CFLAGS = $(CFLAG_EXCEPTIONS)
-%C%_libsandbox_la_LIBADD = libsbutil/libsbutil.la $(LIBDL)
+# Could use the following to libsandbox_la_LIBADD, but then libtool links it
+# with --whole-archive, and libsandbox.so increase with a few KB in size:
+# libsbutil/libsbutil.la
+libsbutil/.libs/libsbutil.a: libsbutil/libsbutil.la
+%C%_libsandbox_la_LIBSBLIB = libsbutil/.libs/libsbutil.a
+%C%_libsandbox_la_LIBADD = \
+ $(%C%_libsandbox_la_LIBSBLIB) \
+ $(LIBDL)
# Do not add -nostdlib or -nostartfiles, as then our constructor
# and destructor will not be executed ...
%C%_libsandbox_la_LDFLAGS = \
diff --git a/libsbutil/sb_backtrace.c b/libsbutil/sb_backtrace.c
index f06b781..e3d1ed7 100644
--- a/libsbutil/sb_backtrace.c
+++ b/libsbutil/sb_backtrace.c
@@ -10,7 +10,6 @@
#include "headers.h"
#include "sbutil.h"
-__attribute__((weak))
void __sb_dump_backtrace(void)
{
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] proj/sandbox:master commit in: libsandbox/, libsbutil/
2025-01-08 2:12 [gentoo-commits] proj/sandbox:stable-2.x commit in: libsbutil/, libsandbox/ Mike Gilbert
@ 2025-01-14 4:38 ` Mike Gilbert
0 siblings, 0 replies; 5+ messages in thread
From: Mike Gilbert @ 2025-01-14 4:38 UTC (permalink / raw
To: gentoo-commits
commit: d9a4a0c97f4840e3c6b84fa6302ed511dd73705b
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 8 02:11:31 2025 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Jan 8 02:11:31 2025 +0000
URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=d9a4a0c9
libsandbox: simplify reference to libsbutil
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
libsandbox/local.mk | 9 +--------
libsbutil/sb_backtrace.c | 1 +
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/libsandbox/local.mk b/libsandbox/local.mk
index d2fb1d1..b3ccd39 100644
--- a/libsandbox/local.mk
+++ b/libsandbox/local.mk
@@ -9,14 +9,7 @@ lib_LTLIBRARIES += %D%/libsandbox.la
-I$(top_srcdir)/libsbutil/include
%C%_libsandbox_la_CFLAGS = $(CFLAG_EXCEPTIONS)
-# Could use the following to libsandbox_la_LIBADD, but then libtool links it
-# with --whole-archive, and libsandbox.so increase with a few KB in size:
-# libsbutil/libsbutil.la
-libsbutil/.libs/libsbutil.a: libsbutil/libsbutil.la
-%C%_libsandbox_la_LIBSBLIB = libsbutil/.libs/libsbutil.a
-%C%_libsandbox_la_LIBADD = \
- $(%C%_libsandbox_la_LIBSBLIB) \
- $(LIBDL)
+%C%_libsandbox_la_LIBADD = libsbutil/libsbutil.la $(LIBDL)
# Do not add -nostdlib or -nostartfiles, as then our constructor
# and destructor will not be executed ...
%C%_libsandbox_la_LDFLAGS = \
diff --git a/libsbutil/sb_backtrace.c b/libsbutil/sb_backtrace.c
index e3d1ed7..f06b781 100644
--- a/libsbutil/sb_backtrace.c
+++ b/libsbutil/sb_backtrace.c
@@ -10,6 +10,7 @@
#include "headers.h"
#include "sbutil.h"
+__attribute__((weak))
void __sb_dump_backtrace(void)
{
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] proj/sandbox:master commit in: libsandbox/, libsbutil/
@ 2025-03-09 18:27 Mike Gilbert
0 siblings, 0 replies; 5+ messages in thread
From: Mike Gilbert @ 2025-03-09 18:27 UTC (permalink / raw
To: gentoo-commits
commit: b794dc4c4fc421713d82c75d8a14be9b85ba2482
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 9 05:16:54 2025 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Mar 9 18:22:21 2025 +0000
URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=b794dc4c
libsbutil: move sb_close_all_fds into libsandbox
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
libsandbox/trace.c | 25 ++++++++++++++++++++++++-
libsbutil/local.mk | 1 -
libsbutil/sb_close.c | 35 -----------------------------------
libsbutil/sbutil.h | 1 -
4 files changed, 24 insertions(+), 38 deletions(-)
diff --git a/libsandbox/trace.c b/libsandbox/trace.c
index 40d83cd..b9a9470 100644
--- a/libsandbox/trace.c
+++ b/libsandbox/trace.c
@@ -524,6 +524,29 @@ static void trace_loop(void)
} while (1);
}
+static void close_all_fds(void)
+{
+ DIR *dirp;
+ struct dirent *de;
+ int dfd, fd;
+ const char *fd_dir = sb_get_fd_dir();
+
+ dirp = opendir(fd_dir);
+ if (!dirp)
+ sb_ebort("could not process %s\n", fd_dir);
+ dfd = dirfd(dirp);
+
+ while ((de = readdir(dirp)) != NULL) {
+ if (de->d_name[0] == '.')
+ continue;
+ fd = atoi(de->d_name);
+ if (fd != dfd)
+ close(fd);
+ }
+
+ closedir(dirp);
+}
+
void trace_main(void)
{
struct sigaction old_sa, sa = { .sa_handler = SIG_DFL, };
@@ -545,7 +568,7 @@ void trace_main(void)
PTRACE_O_TRACEEXIT |
PTRACE_O_TRACESYSGOOD
));
- sb_close_all_fds();
+ close_all_fds();
trace_loop();
sb_ebort("ISE: child should have quit, as should we\n");
}
diff --git a/libsbutil/local.mk b/libsbutil/local.mk
index 12d6526..b1980de 100644
--- a/libsbutil/local.mk
+++ b/libsbutil/local.mk
@@ -25,7 +25,6 @@ noinst_LIBRARIES += %D%/libsbutil.a
%D%/sb_stat.c \
%D%/sb_write.c \
%D%/sb_write_fd.c \
- %D%/sb_close.c \
%D%/sb_printf.c \
%D%/sb_proc.c \
%D%/sb_memory.c \
diff --git a/libsbutil/sb_close.c b/libsbutil/sb_close.c
deleted file mode 100644
index 5f7def7..0000000
--- a/libsbutil/sb_close.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * sb_close.c
- *
- * IO functions.
- *
- * Copyright 1999-2012 Gentoo Foundation
- * Licensed under the GPL-2
- */
-
-#include "headers.h"
-#include "sbutil.h"
-
-/* Quickly close all the open fds (good for daemonization) */
-void sb_close_all_fds(void)
-{
- DIR *dirp;
- struct dirent *de;
- int dfd, fd;
- const char *fd_dir = sb_get_fd_dir();
-
- dirp = opendir(fd_dir);
- if (!dirp)
- sb_ebort("could not process %s\n", fd_dir);
- dfd = dirfd(dirp);
-
- while ((de = readdir(dirp)) != NULL) {
- if (de->d_name[0] == '.')
- continue;
- fd = atoi(de->d_name);
- if (fd != dfd)
- close(fd);
- }
-
- closedir(dirp);
-}
diff --git a/libsbutil/sbutil.h b/libsbutil/sbutil.h
index d092868..5d74c93 100644
--- a/libsbutil/sbutil.h
+++ b/libsbutil/sbutil.h
@@ -107,7 +107,6 @@ extern const char sbio_fallback_path[];
int sb_open(const char *path, int flags, mode_t mode);
size_t sb_read(int fd, void *buf, size_t count);
size_t sb_write(int fd, const void *buf, size_t count);
-void sb_close_all_fds(void);
int sb_copy_file_to_fd(const char *file, int ofd);
int sb_exists(int dirfd, const char *pathname, int flags);
int sb_fstat(int fd, mode_t *mode, int64_t *size);
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-03-09 18:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-13 17:50 [gentoo-commits] proj/sandbox:stable-2.x commit in: libsandbox/, libsbutil/ Mike Gilbert
2025-01-14 4:38 ` [gentoo-commits] proj/sandbox:master " Mike Gilbert
-- strict thread matches above, loose matches on Subject: below --
2025-03-09 18:27 Mike Gilbert
2025-01-08 2:12 [gentoo-commits] proj/sandbox:stable-2.x commit in: libsbutil/, libsandbox/ Mike Gilbert
2025-01-14 4:38 ` [gentoo-commits] proj/sandbox:master commit in: libsandbox/, libsbutil/ Mike Gilbert
2021-10-21 8:06 Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox