Content-Type: multipart/mixed; boundary="===============0535042563679257770==" MIME-Version: 1.0 From: Ramesh Thomas Subject: [Accel-config] [PATCH 5/5] accel-config: Check for file existence instead of read permission Date: Wed, 01 Dec 2021 18:59:09 -0500 Message-ID: <20211201235909.108260-6-ramesh.thomas@intel.com> In-Reply-To: 20211201235909.108260-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============0535042563679257770== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ramesh Thomas 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 --- 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 =3D 1; log_init(&c->ctx, "libaccfg", "ACCFG_LOG"); c->timeout =3D 5000; - if (access(IDXD_DRIVER_BIND_PATH, R_OK)) + if (access(IDXD_DRIVER_BIND_PATH, F_OK)) c->compat =3D true; = list_head_init(&c->devices); -- = 2.26.3 --===============0535042563679257770==--