From: Michal Luscon Date: Wed, 8 Feb 2012 15:27:08 +0000 (+0100) Subject: eject: simplify find_device X-Git-Tag: v2.22-rc1~555^2~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d36e80a7592b5d4c4c8b692a2afdaf5cf26d9b90;p=thirdparty%2Futil-linux.git eject: simplify find_device Signed-off-by: Michal Luscon --- diff --git a/misc-utils/eject b/misc-utils/eject deleted file mode 100755 index 9570209fff..0000000000 Binary files a/misc-utils/eject and /dev/null differ diff --git a/misc-utils/eject.c b/misc-utils/eject.c index 8d8a8bf3fc..de03878237 100644 --- a/misc-utils/eject.c +++ b/misc-utils/eject.c @@ -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;