summaryrefslogtreecommitdiffstats
path: root/sys-utils/eject.c
diff options
context:
space:
mode:
authorSami Kerola2014-10-15 23:19:25 +0200
committerKarel Zak2014-10-20 14:07:18 +0200
commit6f7f155c0c73702457218e8fa8d08e88ea55b85f (patch)
tree7580130fea68003ebffb8a93738a11572f17d406 /sys-utils/eject.c
parenthwclock: add notes about default behavior changes (diff)
downloadkernel-qcow2-util-linux-6f7f155c0c73702457218e8fa8d08e88ea55b85f.tar.gz
kernel-qcow2-util-linux-6f7f155c0c73702457218e8fa8d08e88ea55b85f.tar.xz
kernel-qcow2-util-linux-6f7f155c0c73702457218e8fa8d08e88ea55b85f.zip
eject: move unreachable code to preprocessor #else block [smatch scan]
eject.c:466 toggle_tray() info: ignoring unreachable code. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/eject.c')
-rw-r--r--sys-utils/eject.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys-utils/eject.c b/sys-utils/eject.c
index 91f1102ab..860610f5a 100644
--- a/sys-utils/eject.c
+++ b/sys-utils/eject.c
@@ -433,9 +433,6 @@ static int eject_cdrom(int fd)
*/
static void toggle_tray(int fd)
{
- struct timeval time_start, time_stop;
- int time_elapsed;
-
#ifdef CDROM_DRIVE_STATUS
/* First ask the CDROM for info, otherwise fall back to manual. */
switch (ioctl(fd, CDROM_DRIVE_STATUS)) {
@@ -457,7 +454,9 @@ static void toggle_tray(int fd)
default:
abort();
}
-#endif
+#else
+ struct timeval time_start, time_stop;
+ int time_elapsed;
/* Try to open the CDROM tray and measure the time therefor
* needed. In my experience the function needs less than 0.05
@@ -481,6 +480,7 @@ static void toggle_tray(int fd)
* closed before. This would mean that we are done. */
if (time_elapsed < TRAY_WAS_ALREADY_OPEN_USECS)
close_tray(fd);
+#endif
}
/*