OSDN Git Service

OS X: fix raw device size detection.
authorrelan <relan@users.noreply.github.com>
Sat, 15 Dec 2012 08:45:00 +0000 (08:45 +0000)
committerrelan <relan@users.noreply.github.com>
Mon, 24 Aug 2015 05:26:15 +0000 (08:26 +0300)
Each disk has two names: /dev/diskN (block device) and /dev/rdiskN (raw
device).

libexfat/io.c

index e9672fb..e7dcd79 100644 (file)
@@ -147,7 +147,7 @@ struct exfat_dev* exfat_open(const char* spec, enum exfat_mode mode)
        }
 
 #ifdef __APPLE__
-       if (S_ISBLK(stbuf.st_mode))
+       if (!S_ISREG(stbuf.st_mode))
        {
                uint32_t block_size = 0;
                uint64_t blocks = 0;