From e01add895c9ac949f84c643416dff71fd5448a98 Mon Sep 17 00:00:00 2001 From: Kazuki H Date: Sun, 3 Mar 2024 21:24:03 +0900 Subject: [PATCH] =?UTF-8?q?Linux=206.8=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Linux 6.8ではstrlcpyが消されている。 https://github.com/torvalds/linux/commit/d26270061ae66b915138af7cd73ca6f8b85e6b44 --- driver/ptx_chrdev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/driver/ptx_chrdev.c b/driver/ptx_chrdev.c index 1b2319e..7af7269 100644 --- a/driver/ptx_chrdev.c +++ b/driver/ptx_chrdev.c @@ -567,7 +567,11 @@ int ptx_chrdev_context_create(const char *name, const char *devname, return -ENOMEM; mutex_init(&ctx->lock); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) + strscpy(ctx->devname, devname, sizeof(ctx->devname)); +#else strlcpy(ctx->devname, devname, sizeof(ctx->devname)); +#endif INIT_LIST_HEAD(&ctx->group_list);