From: Kay Sievers Date: Fri, 16 Sep 2005 19:23:36 +0000 (+0200) Subject: ata_id: open volume O_NONBLOCK X-Git-Tag: 174~2539 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=3515c0ad001731edd9a1cbf6e3d9a3161d37eb4b ata_id: open volume O_NONBLOCK Opticals like that and should be ok for disks too, as long as we don't read(). Signed-off-by: Kay Sievers --- diff --git a/extras/ata_id/ata_id.c b/extras/ata_id/ata_id.c index 9579db310..ba40555a0 100644 --- a/extras/ata_id/ata_id.c +++ b/extras/ata_id/ata_id.c @@ -122,10 +122,7 @@ int main(int argc, char *argv[]) goto exit; } - fd = open(node, O_RDONLY); - if (fd < 0) - if (errno == ENOMEDIUM) - fd = open(node, O_RDONLY|O_NONBLOCK); + fd = open(node, O_RDONLY|O_NONBLOCK); if (fd < 0) { err("unable to open '%s'", node); rc = 1;