Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librc: remove gentoo prefix support #751

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions src/librc/librc.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,23 +233,6 @@ get_systype(void)
return systype;
}

static const char *
detect_prefix(const char *systype)
{
#ifdef PREFIX
return RC_SYS_PREFIX;
#else
if (systype) {
if (strcmp(systype, RC_SYS_NONE) == 0)
return NULL;
if (strcmp(systype, RC_SYS_PREFIX) == 0)
return RC_SYS_PREFIX;
}

return NULL;
#endif
}

static const char *
detect_container(const char *systype RC_UNUSED)
{
Expand Down Expand Up @@ -367,12 +350,9 @@ rc_sys(void)
const char *sys;

systype = get_systype();
sys = detect_prefix(systype);
sys = detect_container(systype);
if (!sys) {
sys = detect_container(systype);
if (!sys) {
sys = detect_vm(systype);
}
sys = detect_vm(systype);
}

return sys;
Expand Down
8 changes: 2 additions & 6 deletions src/librc/rc.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@
extern "C" {
#endif

#define RC_PREFIX "@PREFIX@"
#define RC_SYSCONFDIR "@SYSCONFDIR@"
#define RC_LIBDIR "@PREFIX@/@LIB@/rc"
#define RC_LIBDIR "/@LIB@/rc"
#define RC_LIBEXECDIR "@LIBEXECDIR@"
#if defined(PREFIX)
#define RC_SVCDIR RC_LIBEXECDIR "/init.d"
#elif defined(__linux__) || (defined(__FreeBSD_kernel__) && \
#if defined(__linux__) || (defined(__FreeBSD_kernel__) && \
defined(__GLIBC__)) || defined(__GNU__)
#define RC_SVCDIR "/run/openrc"
#else
Expand Down Expand Up @@ -324,7 +321,6 @@ bool rc_service_daemons_crashed(const char *);
#define RC_SYS_NONE ""
#define RC_SYS_OPENVZ "OPENVZ"
#define RC_SYS_LXC "LXC"
#define RC_SYS_PREFIX "PREFIX"
#define RC_SYS_RKT "RKT"
#define RC_SYS_SYSTEMD_NSPAWN "SYSTEMD-NSPAWN"
#define RC_SYS_UML "UML"
Expand Down
Loading