[Accel-config] [PATCH 5/5] accel-config: Check for file existence instead of read permission
Ramesh Thomas <ramesh.thomas at intel.com> Wed, 01 Dec 2021 18:59:09 -0500
| Newsgroups | dev.linux.lists.accel-config |
|---|---|
| Message-ID | <[email protected]> |
From: Ramesh Thomas <ramesh.thomas(a)linux.intel.com>
Pass F_OK to access to check for existence of files instead of R_OK
which checks for read permission. Even though it does not matter, F_OK
is more relevant in the usage.
Signed-off-by: Ramesh Thomas <ramesh.thomas(a)linux.intel.com>
---
accfg/lib/libaccfg.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c
index a13be34..51086b7 100644
--- a/accfg/lib/libaccfg.c
+++ b/accfg/lib/libaccfg.c
@@ -151,7 +151,7 @@ static void save_last_error(struct accfg_device *device, struct accfg_wq *wq,
static inline bool is_mdev_registered(struct accfg_device *device)
{
- return device->mdev_path && !access(device->mdev_path, R_OK);
+ return device->mdev_path && !access(device->mdev_path, F_OK);
}
static int accfg_set_param(struct accfg_ctx *ctx, int dfd, char *name,
@@ -398,7 +398,7 @@ ACCFG_EXPORT int accfg_new(struct accfg_ctx **ctx)
c->refcount = 1;
log_init(&c->ctx, "libaccfg", "ACCFG_LOG");
c->timeout = 5000;
- if (access(IDXD_DRIVER_BIND_PATH, R_OK))
+ if (access(IDXD_DRIVER_BIND_PATH, F_OK))
c->compat = true;
list_head_init(&c->devices);
--
2.26.3