[PATCH 1/4] eject: move unreachable code to preprocessor #else block [smatch scan]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



eject.c:466 toggle_tray() info: ignoring unreachable code.

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 sys-utils/eject.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys-utils/eject.c b/sys-utils/eject.c
index 91f1102..860610f 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
 }
 
 /*
-- 
2.1.2

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux