[vhostmd PATCH] Remove d_type check for channel directory.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
-- 

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux