summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys-utils/eject.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys-utils/eject.c b/sys-utils/eject.c
index 240e27e74..402152204 100644
--- a/sys-utils/eject.c
+++ b/sys-utils/eject.c
@@ -983,8 +983,15 @@ int main(int argc, char **argv)
free(device);
device = disk;
disk = NULL;
- } else
+ } else {
+ struct stat st;
+
+ if (stat(device, &st) != 0 || !S_ISBLK(st.st_mode))
+ errx(EXIT_FAILURE, _("%s: not found mountpoint or device "
+ "with the given name"), device);
+
verbose(_("%s: is whole-disk device"), device);
+ }
if (F_option == 0 && is_hotpluggable(device) == 0)
errx(EXIT_FAILURE, _("%s: is not hot-pluggable device"), device);