Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144345155
D40975.id124516.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D40975.id124516.diff
View Options
diff --git a/lib/libutil/getlocalbase.3 b/lib/libutil/getlocalbase.3
--- a/lib/libutil/getlocalbase.3
+++ b/lib/libutil/getlocalbase.3
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 25, 2020
+.Dd July 11, 2023
.Dt GETLOCALBASE 3
.Os
.Sh NAME
@@ -53,10 +53,10 @@
.Va user.localbase
sysctl is checked.
If that also does not exist then the value of the
-.Dv _PATH_LOCALBASE
+.Dv LOCALBASE_PATH
compile-time variable is used.
-If that is undefined then the default of
-.Pa /usr/local
+If that is undefined then the system default,
+.Pa _PATH_LOCALBASE
is used.
.Pp
The contents of the string returned by the
diff --git a/lib/libutil/getlocalbase.c b/lib/libutil/getlocalbase.c
--- a/lib/libutil/getlocalbase.c
+++ b/lib/libutil/getlocalbase.c
@@ -37,8 +37,8 @@
#include <libutil.h>
#include <unistd.h>
-#ifndef _PATH_LOCALBASE
-#define _PATH_LOCALBASE "/usr/local"
+#ifndef LOCALBASE_PATH
+#define LOCALBASE_PATH _PATH_LOCALBASE
#endif
#ifndef LOCALBASE_CTL_LEN
@@ -73,17 +73,17 @@
#if LOCALBASE_CTL_LEN > 0
if (sysctl(localbase_oid, 2, localpath, &localpathlen, NULL, 0) != 0) {
if (errno != ENOMEM)
- localbase = _PATH_LOCALBASE;
+ localbase = LOCALBASE_PATH;
else
localbase = ILLEGAL_PREFIX;
} else {
if (localpath[0] != '\0')
localbase = localpath;
else
- localbase = _PATH_LOCALBASE;
+ localbase = LOCALBASE_PATH;
}
#else
- localbase = _PATH_LOCALBASE;
+ localbase = LOCALBASE_PATH;
#endif
return (localbase);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 8, 11:20 PM (26 m, 6 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28491025
Default Alt Text
D40975.id124516.diff (1 KB)
Attached To
Mode
D40975: getlocalbase: Make default path actually configurable
Attached
Detach File
Event Timeline
Log In to Comment