util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] eject: move unreachable code to preprocessor #else block [smatch scan]
@ 2014-10-15 21:19 Sami Kerola
  2014-10-15 21:19 ` [PATCH 2/4] setterm: fix dubious one-bit signed bitfield " Sami Kerola
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sami Kerola @ 2014-10-15 21:19 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa

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

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-20 12:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-15 21:19 [PATCH 1/4] eject: move unreachable code to preprocessor #else block [smatch scan] Sami Kerola
2014-10-15 21:19 ` [PATCH 2/4] setterm: fix dubious one-bit signed bitfield " Sami Kerola
2014-10-15 21:19 ` [PATCH 3/4] ul: fix filter() indentation Sami Kerola
2014-10-15 21:19 ` [PATCH 4/4] sfdisk: fix compiler warnings about uninitialized variables Sami Kerola
2014-10-20 12:10 ` [PATCH 1/4] eject: move unreachable code to preprocessor #else block [smatch scan] Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).