1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

configure.ac: define DEFAULT_PROC_DIR in one place

Let's move proc into include/configure.h so this define can
be easily used across the source base.

Configure defines it - but ATM we do not provide any configure
option to change it - there should be no need to ever change it.
This commit is contained in:
Zdenek Kabelac 2024-04-15 13:36:35 +02:00
parent 2ea8afba93
commit 84b084c9b6
9 changed files with 12 additions and 8 deletions

View File

@ -1032,7 +1032,7 @@ global {
# Location of proc filesystem.
# This configuration option is advanced.
# This configuration option has an automatic default value.
# proc = "/proc"
# proc = "@DEFAULT_PROC_DIR@"
# Configuration option global/etc.
# Location of /etc system configuration directory.

View File

@ -1796,6 +1796,9 @@ AC_MSG_RESULT([$DEFAULT_LOCK_DIR])
AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR, ["$DEFAULT_LOCK_DIR"],
[Name of default locking directory.])
# No --with configure setting, but store in the main configure.h
AC_DEFINE_UNQUOTED(DEFAULT_PROC_DIR, ["/proc"], [Path to /proc.])
################################################################################
dnl -- which kernel interface to use (ioctl only)
AC_MSG_CHECKING([for kernel interface choice])
@ -1880,6 +1883,7 @@ AC_SUBST(DEFAULT_EVENT_ACTIVATION)
AC_SUBST(DEFAULT_LOCK_DIR)
AC_SUBST(DEFAULT_MIRROR_SEGTYPE)
AC_SUBST(DEFAULT_PID_DIR)
AC_SUBST(DEFAULT_PROC_DIR)
AC_SUBST(DEFAULT_PROFILE_SUBDIR)
AC_SUBST(DEFAULT_RAID10_SEGTYPE)
AC_SUBST(DEFAULT_RUN_DIR)

View File

@ -70,6 +70,9 @@
/* Default directory to keep PID files in. */
#undef DEFAULT_PID_DIR
/* Path to /proc. */
#undef DEFAULT_PROC_DIR
/* Name of default configuration profile subdirectory. */
#undef DEFAULT_PROFILE_SUBDIR

View File

@ -1019,7 +1019,7 @@ cfg_array(global_format_libraries_CFG, "format_libraries", global_CFG_SECTION, C
cfg_array(global_segment_libraries_CFG, "segment_libraries", global_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 18), NULL, vsn(2, 3, 3), NULL, NULL)
cfg(global_proc_CFG, "proc", global_CFG_SECTION, CFG_DEFAULT_COMMENTED | CFG_ADVANCED, CFG_TYPE_STRING, DEFAULT_PROC_DIR, vsn(1, 0, 0), NULL, 0, NULL,
cfg(global_proc_CFG, "proc", global_CFG_SECTION, CFG_DEFAULT_COMMENTED | CFG_ADVANCED, CFG_TYPE_STRING, DEFAULT_PROC_DIR, vsn(1, 0, 0), "@DEFAULT_PROC_DIR@", 0, NULL,
"Location of proc filesystem.\n")
cfg(global_etc_CFG, "etc", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_ETC_DIR, vsn(2, 2, 117), "@CONFDIR@", 0, NULL,

View File

@ -40,7 +40,6 @@
#define DEFAULT_ARCHIVE_NUMBER 10
#define DEFAULT_DEV_DIR "/dev"
#define DEFAULT_PROC_DIR "/proc"
#define DEFAULT_SYSTEM_ID_SOURCE "none"
#define DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV 0
#define DEFAULT_EXTERNAL_DEVICE_INFO_SOURCE "none"

View File

@ -220,7 +220,7 @@ void init_log_fn(lvm2_log_fn_t log_fn)
/* Read /proc/self/stat to extract pid and starttime */
static int _get_pid_starttime(int *pid, unsigned long long *starttime)
{
static const char statfile[] = "/proc/self/stat";
static const char statfile[] = DEFAULT_PROC_DIR "/self/stat";
char buf[1024];
char *p;
int fd;

View File

@ -33,8 +33,6 @@
# define MKDEV(x,y) makedev((x),(y))
#endif
#define DEFAULT_PROC_DIR "/proc"
/* limit to two updates/sec */
#define FILEMAPD_WAIT_USECS 500000

View File

@ -981,7 +981,7 @@ struct TestCase {
sleep( 1 ); /* wait a bit for a reaction */
}
if ( !p ) {
std::ofstream tr( "/proc/sysrq-trigger" );
std::ofstream tr( DEFAULT_PROC_DIR "/sysrq-trigger" );
tr << "t";
tr.close();
kill( -pid, SIGKILL );

View File

@ -447,7 +447,7 @@ static void run(int i, char *f) {
* any output, in other case it should be
* user space problem
*/
system("echo t > /proc/sysrq-trigger");
system("echo t > " DEFAULT_PROC_DIR "/sysrq-trigger");
collect_debug = 1;
kill(-pid, SIGKILL);
w = pid; // waitpid(pid, &st, NULL);