diff options
| author | Stefan Eßer <se@FreeBSD.org> | 2020-10-27 11:29:11 +0000 |
|---|---|---|
| committer | Stefan Eßer <se@FreeBSD.org> | 2020-10-27 11:29:11 +0000 |
| commit | 1f474190fc280d4a4ef0c214e4d7fff0d1237e22 (patch) | |
| tree | 123ca2f0a46ad9a1203a6b3c7a7a38c2a50854e6 /usr.sbin | |
| parent | 7b39bef2cf93f6f0e79cc55a8ee2d339e42a6816 (diff) | |
Notes
Diffstat (limited to 'usr.sbin')
| -rw-r--r-- | usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c | 3 | ||||
| -rw-r--r-- | usr.sbin/cpucontrol/cpucontrol.c | 3 | ||||
| -rw-r--r-- | usr.sbin/cron/cron/pathnames.h | 2 | ||||
| -rw-r--r-- | usr.sbin/mailwrapper/mailwrapper.c | 3 | ||||
| -rw-r--r-- | usr.sbin/pciconf/pathnames.h | 4 | ||||
| -rw-r--r-- | usr.sbin/pkg/config.c | 3 | ||||
| -rw-r--r-- | usr.sbin/pkg/config.h | 3 | ||||
| -rw-r--r-- | usr.sbin/pkg/pkg.c | 2 |
8 files changed, 15 insertions, 8 deletions
diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c index d4f305fc2ff6e..77785313ff92b 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c @@ -81,6 +81,7 @@ #include <err.h> #include <errno.h> #include <fcntl.h> +#include <paths.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -148,7 +149,7 @@ static int32_t pbchar = -1; static const char *paths[MAX_PATHS + 1] = { "/usr/share/snmp/defs", - "/usr/local/share/snmp/defs", + _PATH_LOCALBASE "/share/snmp/defs", NULL }; diff --git a/usr.sbin/cpucontrol/cpucontrol.c b/usr.sbin/cpucontrol/cpucontrol.c index 31b1d165af308..09948cc95d6cb 100644 --- a/usr.sbin/cpucontrol/cpucontrol.c +++ b/usr.sbin/cpucontrol/cpucontrol.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include <errno.h> #include <dirent.h> #include <fcntl.h> +#include <paths.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -59,7 +60,7 @@ __FBSDID("$FreeBSD$"); int verbosity_level = 0; -#define DEFAULT_DATADIR "/usr/local/share/cpucontrol" +#define DEFAULT_DATADIR _PATH_LOCALBASE "/share/cpucontrol" #define FLAG_I 0x01 #define FLAG_M 0x02 diff --git a/usr.sbin/cron/cron/pathnames.h b/usr.sbin/cron/cron/pathnames.h index e25519fa89eb8..b0edbd897a28c 100644 --- a/usr.sbin/cron/cron/pathnames.h +++ b/usr.sbin/cron/cron/pathnames.h @@ -59,7 +59,7 @@ /* 4.3BSD-style crontab */ #define SYSCRONTAB "/etc/crontab" #define SYSCRONTABS "/etc/cron.d" -#define LOCALSYSCRONTABS "/usr/local/etc/cron.d" +#define LOCALSYSCRONTABS _PATH_LOCALBASE "/etc/cron.d" /* what editor to use if no EDITOR or VISUAL * environment variable specified. diff --git a/usr.sbin/mailwrapper/mailwrapper.c b/usr.sbin/mailwrapper/mailwrapper.c index 1ad4053a843e5..8a9ec220a26b6 100644 --- a/usr.sbin/mailwrapper/mailwrapper.c +++ b/usr.sbin/mailwrapper/mailwrapper.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <err.h> +#include <paths.h> #include <stdio.h> #include <string.h> #include <unistd.h> @@ -105,7 +106,7 @@ main(int argc, char *argv[], char *envp[]) addarg(&al, argv[0]); snprintf(localmailerconf, MAXPATHLEN, "%s/etc/mail/mailer.conf", - getenv("LOCALBASE") ? getenv("LOCALBASE") : "/usr/local"); + getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE); mailerconf = localmailerconf; if ((config = fopen(localmailerconf, "r")) == NULL) diff --git a/usr.sbin/pciconf/pathnames.h b/usr.sbin/pciconf/pathnames.h index 61c0993bbb7c4..c35c721aa8384 100644 --- a/usr.sbin/pciconf/pathnames.h +++ b/usr.sbin/pciconf/pathnames.h @@ -1,4 +1,6 @@ /* $FreeBSD$ */ +#include <paths.h> + #define _PATH_DEVPCI "/dev/pci" #define _PATH_PCIVDB "/usr/share/misc/pci_vendors" -#define _PATH_LPCIVDB "/usr/local/share/pciids/pci.ids" +#define _PATH_LPCIVDB _PATH_LOCALBASE "/share/pciids/pci.ids" diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index fc7df8d31dae9..a1dba3f2670ac 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include <ucl.h> #include <err.h> #include <errno.h> +#include <paths.h> #include <stdbool.h> #include <unistd.h> @@ -454,7 +455,7 @@ config_init(void) } /* Read LOCALBASE/etc/pkg.conf first. */ - localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE; + localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE; snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf", localbase); diff --git a/usr.sbin/pkg/config.h b/usr.sbin/pkg/config.h index a63997a7a60d3..f1a2aa227f16f 100644 --- a/usr.sbin/pkg/config.h +++ b/usr.sbin/pkg/config.h @@ -31,7 +31,8 @@ #ifndef _PKG_CONFIG_H #define _PKG_CONFIG_H -#define _LOCALBASE "/usr/local" +#include <paths.h> + #define URL_SCHEME_PREFIX "pkg+" typedef enum { diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 50b196fd9b30a..3de789328c37c 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -1046,7 +1046,7 @@ main(int argc, char *argv[]) yes = false; snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", - getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); + getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE); if (argc > 1 && strcmp(argv[1], "bootstrap") == 0) { bootstrap_only = true; |
