From 95a3ec7af502aee711bc1f801183198a81358034 Mon Sep 17 00:00:00 2001 From: RToax <2386499836@qq.com> Date: Thu, 30 Sep 2021 06:40:57 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=BC=96=E8=AF=91=E8=AD=A6?= =?UTF-8?q?=E5=91=8A=20warning:=20passing=20argument=202=20to=20restrict-q?= =?UTF-8?q?ualified=20parameter=20aliases=20with=20argument=201=20gcc=20-W?= =?UTF-8?q?all=20-g=20-O2=20-D=5FGNU=5FSOURCE=20-I=20/home/rongtao/libcare?= =?UTF-8?q?plus/src=20-Wuninitialized=20-Wreturn-type=20-Wno-builtin-macro?= =?UTF-8?q?-redefined=20-Wno-deprecated-declarations=20-DDEBUG=20-O0=20-g?= =?UTF-8?q?=20=20-o=20kpatch=5Fuser.o=20-c=20kpatch=5Fuser.c=20kpatch=5Fus?= =?UTF-8?q?er.c:=20In=20function=20=E2=80=98processes=5Fdo=E2=80=99:=20kpa?= =?UTF-8?q?tch=5Fuser.c:895:22:=20warning:=20passing=20argument=202=20to?= =?UTF-8?q?=20restrict-qualified=20parameter=20aliases=20with=20argument?= =?UTF-8?q?=201=20[-Wrestrict]=20=20=20=20rv=20=3D=20readlink(buf,=20buf,?= =?UTF-8?q?=20sizeof(buf));?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/kpatch_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kpatch_user.c b/src/kpatch_user.c index 11e3408..c74a5cd 100644 --- a/src/kpatch_user.c +++ b/src/kpatch_user.c @@ -869,7 +869,7 @@ processes_do(int pid, callback_t callback, void *data) DIR *dir; struct dirent *de; int ret = 0, rv; - char *tmp, buf[64]; + char *tmp, buf[64], buf2[64]; if (pid != -1) return callback(pid, data); @@ -892,7 +892,7 @@ processes_do(int pid, callback_t callback, void *data) continue; snprintf(buf, sizeof(buf), "/proc/%d/exe", pid); - rv = readlink(buf, buf, sizeof(buf)); + rv = readlink(buf, buf2, sizeof(buf2)); if (rv == -1) { if (errno == ENOENT) kpdebug("skipping kernel thread %d\n", pid); -- Gitee