Skip to content

Commit

Permalink
librc: remove gentoo prefix support
Browse files Browse the repository at this point in the history
  • Loading branch information
williamh committed Sep 20, 2024
1 parent 723fa1e commit 74ec840
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
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

0 comments on commit 74ec840

Please sign in to comment.