]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
eject: simplify find_device
authorMichal Luscon <mluscon@redhat.com>
Wed, 8 Feb 2012 15:27:08 +0000 (16:27 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 27 Mar 2012 11:04:58 +0000 (13:04 +0200)
Signed-off-by: Michal Luscon <mluscon@redhat.com>
misc-utils/eject [deleted file]
misc-utils/eject.c

diff --git a/misc-utils/eject b/misc-utils/eject
deleted file mode 100755 (executable)
index 9570209..0000000
Binary files a/misc-utils/eject and /dev/null differ
index 8d8a8bf3fc8c2f2e7d947f73d807bc4cca81a68a..de03878237e3c3a4679e9e4e2e41a2578e621d49 100644 (file)
@@ -292,13 +292,6 @@ static int FileExists(const char *name)
  *
  * foo (if foo starts with '.' or '/')
  * /dev/foo
- * /media/foo
- * /mnt/foo
- * /dev/cdroms/foo
- * /dev/cdroms/foo0
- * /dev/dsk/foo
- * /dev/rdsk/foo
- * ./foo
  *
  * If found, return the full path. If not found, return 0.
  * Returns pointer to dynamically allocated string.
@@ -320,44 +313,6 @@ static char *find_device(const char *name)
        if (FileExists(buf))
                return buf;
 
-       strcpy(buf, "/media/");
-       strcat(buf, name);
-       if (FileExists(buf))
-               return buf;
-
-       strcpy(buf, "/mnt/");
-       strcat(buf, name);
-       if (FileExists(buf))
-               return buf;
-
-       /* for devfs under Linux */
-       strcpy(buf, "/dev/cdroms/");
-       strcat(buf, name);
-       if (FileExists(buf))
-               return buf;
-
-       strcpy(buf, "/dev/cdroms/");
-       strcat(buf, name);
-       strcat(buf, "0");
-       if (FileExists(buf))
-               return buf;
-
-       /* for devfs under Solaris */
-       strcpy(buf, "/dev/rdsk/");
-       strcat(buf, name);
-       if (FileExists(buf))
-               return buf;
-
-       strcpy(buf, "/dev/dsk/");
-       strcat(buf, name);
-       if (FileExists(buf))
-               return buf;
-
-       strcpy(buf, "./");
-       strcat(buf, name);
-       if (FileExists(buf))
-               return buf;
-
        free(buf);
        buf = 0;
        return 0;