summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorKarel Zak2008-12-26 01:09:34 +0100
committerKarel Zak2008-12-26 01:13:03 +0100
commit6db46818025102003d0c739f024500ef3925b4db (patch)
tree0b9feefe8f3ec84859fb41334df1a4114c8d3530 /disk-utils
parentmount: add rootcontext= SELinux mount option (diff)
downloadkernel-qcow2-util-linux-6db46818025102003d0c739f024500ef3925b4db.tar.gz
kernel-qcow2-util-linux-6db46818025102003d0c739f024500ef3925b4db.tar.xz
kernel-qcow2-util-linux-6db46818025102003d0c739f024500ef3925b4db.zip
raw: default to /dev/raw/rawctl
The raw devices are in the raw/ subdirectory. It makes sense to use the same subdirectory also for the control file. The old /dev/rawctl is also supported as a fallback. The #ifdef OLD_RAW_DEVS (/dev/raw<N>) is unsupported from now. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/raw.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/disk-utils/raw.c b/disk-utils/raw.c
index 7c90f2b49..bc64b349e 100644
--- a/disk-utils/raw.c
+++ b/disk-utils/raw.c
@@ -23,14 +23,12 @@
#include <linux/major.h>
#include "nls.h"
-#ifdef OLD_RAW_DEVS
-#define RAWCTLDEV "/dev/raw"
-#define RAWDEVDIR "/dev/"
-#else
-#define RAWCTLDEV "/dev/rawctl"
+
#define RAWDEVDIR "/dev/raw/"
-#endif
-#define DEVFS_RAWCTLDEV "/dev/raw/rawctl"
+#define RAWDEVCTL RAWDEVDIR "rawctl"
+/* deprecated */
+#define RAWDEVCTL_OLD "/dev/rawctl"
+
#define RAW_NR_MINORS 8192
@@ -196,14 +194,14 @@ void open_raw_ctl(void)
{
int errsv;
- master_fd = open(RAWCTLDEV, O_RDWR, 0);
+ master_fd = open(RAWDEVCTL, O_RDWR, 0);
if (master_fd < 0) {
errsv = errno;
- master_fd = open(DEVFS_RAWCTLDEV, O_RDWR, 0);
+ master_fd = open(RAWDEVCTL_OLD, O_RDWR, 0);
if (master_fd < 0) {
- fprintf (stderr,
+ fprintf (stderr,
_("Cannot open master raw device '"
- RAWCTLDEV
+ RAWDEVCTL
"' (%s)\n"), strerror(errsv));
exit(2);
}