From 9dcd6c31e7840d6916a4ff4d948faf3a87ddff0a Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sun, 9 Feb 2020 11:15:43 -0800 Subject: [PATCH] utils: Constify the posix clock interface. The function to open a posix clock never modifies the passed in string. This patch adds the const keyword to ensure this function stays that way. Signed-off-by: Richard Cochran Reviewed-by: Jacob Keller --- util.c | 2 +- util.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util.c b/util.c index e64a93d..43d6224 100644 --- a/util.c +++ b/util.c @@ -190,7 +190,7 @@ char *portaddr2str(struct PortAddress *addr) return buf; } -clockid_t posix_clock_open(char *device, int *phc_index) +clockid_t posix_clock_open(const char *device, int *phc_index) { struct sk_ts_info ts_info; char phc_device[19]; diff --git a/util.h b/util.h index 60d28ac..11e0935 100644 --- a/util.h +++ b/util.h @@ -116,7 +116,7 @@ char *portaddr2str(struct PortAddress *addr); * @param phc_index Returns the PHC index, if any. * @return A valid clock ID on success or CLOCK_INVALID otherwise. */ -clockid_t posix_clock_open(char *device, int *phc_index); +clockid_t posix_clock_open(const char *device, int *phc_index); /** * Compare two port identities for equality.