aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2015-12-23 15:37:51 -0500
committerKevin O'Connor <kevin@koconnor.net>2015-12-28 11:48:27 -0500
commit82f327976865ba151153a04b584fc5d0a1fc5d9b (patch)
treec990f7bbeb0bb7567f5457001d9a808c52fa4b7d /src
parent0c5a6077fc569d27aeadde690810f820b3256fbd (diff)
downloadseabios-82f327976865ba151153a04b584fc5d0a1fc5d9b.tar.gz
scsi: Do not call printf() from scsi_is_ready()
The scsi_is_ready() function may be called from a thread, and it is not valid to call printf() from a thread. Convert printf() to dprintf() to avoid this possibility. This does mean that cdrom detection (from cdrom_boot() ) may not give notification of slow cdrom drives to a user. However, the extra medium detection time is unlikely to be large anyway. Reported-by: Tobias Diedrich <tobiasdiedrich@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r--src/hw/blockcmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hw/blockcmd.c b/src/hw/blockcmd.c
index e20e3fc6..0725b46d 100644
--- a/src/hw/blockcmd.c
+++ b/src/hw/blockcmd.c
@@ -168,7 +168,7 @@ scsi_is_ready(struct disk_op_s *op)
if (sense.asc == 0x04 && sense.ascq == 0x01 && !in_progress) {
/* IN PROGRESS OF BECOMING READY */
- printf("Waiting for device to detect medium... ");
+ dprintf(1, "Waiting for device to detect medium... ");
/* Allow 30 seconds more */
end = timer_calc(30000);
in_progress = 1;