From 863e043adcc5c4b94272a8169428441838dca11a Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sat, 8 Apr 2017 15:41:03 +0200 Subject: [PATCH 159/325] usr.sbin/cdcontrol: Retry closing after ENOTTY failures (XXX: not really) This doesn't actually work but the commit is kept around as a reminder to fix it. Obtained from: ElectroBSD --- usr.sbin/cdcontrol/cdcontrol.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.sbin/cdcontrol/cdcontrol.c b/usr.sbin/cdcontrol/cdcontrol.c index 546c20b6f94a..0fa1f7a02534 100644 --- a/usr.sbin/cdcontrol/cdcontrol.c +++ b/usr.sbin/cdcontrol/cdcontrol.c @@ -389,6 +389,10 @@ run(int cmd, char *arg) (void) ioctl (fd, CDIOCALLOW); rc = ioctl (fd, CDIOCCLOSE); + if (rc == ENOTTY) { + warnx("Retrying"); + rc = ioctl (fd, CDIOCCLOSE); + } if (rc < 0) return (rc); close(fd); -- 2.32.0