diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2023-09-29 15:50:19 +1000 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-10-04 23:23:35 +0200 |
commit | 6471c7d01b0aad9d144448290557fcd783562228 (patch) | |
tree | 07c664f50790f205080f64d02a2b860f3642e8f7 /log.c | |
parent | fc8f0f8c48ef12edbf60f74f37024917f5812385 (diff) | |
download | passt-6471c7d01b0aad9d144448290557fcd783562228.tar passt-6471c7d01b0aad9d144448290557fcd783562228.tar.gz passt-6471c7d01b0aad9d144448290557fcd783562228.tar.bz2 passt-6471c7d01b0aad9d144448290557fcd783562228.tar.lz passt-6471c7d01b0aad9d144448290557fcd783562228.tar.xz passt-6471c7d01b0aad9d144448290557fcd783562228.tar.zst passt-6471c7d01b0aad9d144448290557fcd783562228.zip |
cppcheck: Make many pointers const
Newer versions of cppcheck (as of 2.12.0, at least) added a warning for
pointers which could be declared to point at const data, but aren't.
Based on that, make many pointers throughout the codebase const.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -216,7 +216,7 @@ void logfile_init(const char *name, const char *path, size_t size) * * #syscalls lseek ppc64le:_llseek ppc64:_llseek armv6l:_llseek armv7l:_llseek */ -static void logfile_rotate_fallocate(int fd, struct timespec *ts) +static void logfile_rotate_fallocate(int fd, const struct timespec *ts) { char buf[BUFSIZ], *nl; int n; @@ -253,7 +253,7 @@ static void logfile_rotate_fallocate(int fd, struct timespec *ts) * #syscalls lseek ppc64le:_llseek ppc64:_llseek armv6l:_llseek armv7l:_llseek * #syscalls ftruncate */ -static void logfile_rotate_move(int fd, struct timespec *ts) +static void logfile_rotate_move(int fd, const struct timespec *ts) { int header_len, write_offset, end, discard, n; char buf[BUFSIZ], *nl; @@ -318,7 +318,7 @@ out: * * fallocate() passed as EXTRA_SYSCALL only if FALLOC_FL_COLLAPSE_RANGE is there */ -static int logfile_rotate(int fd, struct timespec *ts) +static int logfile_rotate(int fd, const struct timespec *ts) { if (fcntl(fd, F_SETFL, O_RDWR /* Drop O_APPEND: explicit lseek() */)) return -errno; |