]> err.no Git - util-linux/commitdiff
raw: default to /dev/raw/rawctl
authorKarel Zak <kzak@redhat.com>
Fri, 26 Dec 2008 00:09:34 +0000 (01:09 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 26 Dec 2008 00:13:03 +0000 (01:13 +0100)
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>
disk-utils/raw.c

index 7c90f2b492b17cb21a50d29add177407b96f2e7c..bc64b349e9136d73eac3ad79b2d8f7dbd08fc920 100644 (file)
 #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);
                }