[virt-tools-list] [vhostmd PATCH] Remove d_type check for channel directory.

Michael Trapp Michael.Trapp at sap.com
Mon Jan 28 15:38:37 UTC 2019


We can't rely on d_type == DT_DIR because on some filesystems
d_type is not supported. A check for domain-ID-NAME/org.github.vhostmd.1
should be sufficient.
---
 vhostmd/virtio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/vhostmd/virtio.c b/vhostmd/virtio.c
index 3cc0f6e..f227b45 100644
--- a/vhostmd/virtio.c
+++ b/vhostmd/virtio.c
@@ -278,8 +278,7 @@ static int vio_readdir(const char * path)
     while ((ent = readdir(dir)) != NULL) {
         int rc, id;
 
-        if (ent->d_type == DT_DIR &&
-            sscanf(ent->d_name, "domain-%d-", &id) == 1) {
+        if (sscanf(ent->d_name, "domain-%d-", &id) == 1) {
 
             char tmp[SUN_PATH_LEN + 8];
             struct stat st;
-- 




More information about the virt-tools-list mailing list