[virt-tools-list] [vhostmd PATCH] Remove d_type check for channel directory.
Jim Fehlig
jfehlig at suse.com
Wed Feb 6 17:11:56 UTC 2019
On 1/28/19 8:38 AM, Michael Trapp wrote:
> 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.
From the readdir(3) man page it looks like xfs is one of the unsupported
filesystems.
> ---
> 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;
>
ACK and pushed. Thanks!
Regards,
Jim
More information about the virt-tools-list
mailing list