mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Cope with intentionally missing /proc.
This commit is contained in:
parent
446155d94f
commit
258c50db74
@ -28,6 +28,7 @@
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
|
||||
#define NUMBER_OF_MAJORS 256
|
||||
|
||||
@ -103,6 +104,14 @@ static int *_scan_proc_dev(const char *proc, struct config_node *cn)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!*proc) {
|
||||
log_verbose("No proc filesystem found: using all block device "
|
||||
"types");
|
||||
for (i = 0; i < NUMBER_OF_MAJORS; i++)
|
||||
max_partitions_by_major[i] = 1;
|
||||
return max_partitions_by_major;
|
||||
}
|
||||
|
||||
if (lvm_snprintf(proc_devices, sizeof(proc_devices),
|
||||
"%s/devices", proc) < 0) {
|
||||
log_error("Failed to create /proc/devices string");
|
||||
|
Loading…
Reference in New Issue
Block a user