aboutgitcodebugslistschat
path: root/qrap.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-09-28 14:33:25 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-09-29 12:22:17 +0200
commit6aca100469838a030542283013589d99a002d10d (patch)
tree8741206d9e76baf9503a8b5841b18ac1c4d19309 /qrap.c
parentfb15259205c006149fc0bedbf4ef135e53c4268e (diff)
downloadpasst-6aca100469838a030542283013589d99a002d10d.tar
passt-6aca100469838a030542283013589d99a002d10d.tar.gz
passt-6aca100469838a030542283013589d99a002d10d.tar.bz2
passt-6aca100469838a030542283013589d99a002d10d.tar.lz
passt-6aca100469838a030542283013589d99a002d10d.tar.xz
passt-6aca100469838a030542283013589d99a002d10d.tar.zst
passt-6aca100469838a030542283013589d99a002d10d.zip
cppcheck: Use inline suppressions for qrap.c
qrap.c uses several old-fashioned functions that cppcheck complains about. Since it's headed for obselesence anyway, just suppress these rather than attempting to modernize the code. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'qrap.c')
-rw-r--r--qrap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/qrap.c b/qrap.c
index a7d0645..3138386 100644
--- a/qrap.c
+++ b/qrap.c
@@ -179,12 +179,14 @@ int main(int argc, char **argv)
char env_path[ARG_MAX + 1], *p, command[ARG_MAX];
strncpy(env_path, getenv("PATH"), ARG_MAX);
+ /* cppcheck-suppress strtokCalled */
p = strtok(env_path, ":");
while (p) {
snprintf(command, ARG_MAX, "%s/%s", p, argv[2]);
if (!access(command, X_OK))
goto valid_args;
+ /* cppcheck-suppress strtokCalled */
p = strtok(NULL, ":");
}
}
@@ -317,6 +319,7 @@ retry:
*/
if (retry_on_reset && rc == ECONNRESET) {
retry_on_reset--;
+ /* cppcheck-suppress usleepCalled */
usleep(50 * 1000);
goto retry;
}