diff options
author | Nathan Scott <nathans@redhat.com> | 2023-10-09 10:48:38 +1100 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2023-10-10 09:18:47 +1100 |
commit | 4103c23327359a0bd6385c2f891554f206fec397 (patch) | |
tree | 30eec810c157643b63713af1776d9bfb1de141c6 /linux/CGroupUtils.c | |
parent | 2978af01a79d1627d7fa90fda0efec9cf774d901 (diff) |
strchrnul is a GNU libc extension, add a wrapper for other platforms
Diffstat (limited to 'linux/CGroupUtils.c')
-rw-r--r-- | linux/CGroupUtils.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/linux/CGroupUtils.c b/linux/CGroupUtils.c index c11c4608..e8d5f1de 100644 --- a/linux/CGroupUtils.c +++ b/linux/CGroupUtils.c @@ -94,7 +94,7 @@ static bool CGroup_filterName_internal(const char* cgroup, StrBuf_state* s, StrB } const char* labelStart = cgroup; - const char* nextSlash = strchrnul(labelStart, '/'); + const char* nextSlash = String_strchrnul(labelStart, '/'); const size_t labelLen = nextSlash - labelStart; if (Label_checkEqual(labelStart, labelLen, str_system_slice)) { @@ -104,7 +104,7 @@ static bool CGroup_filterName_internal(const char* cgroup, StrBuf_state* s, StrB return false; if (String_startsWith(cgroup, str_system_slice_prefix)) { - cgroup = strchrnul(cgroup + 1, '/'); + cgroup = String_strchrnul(cgroup + 1, '/'); continue; } @@ -129,7 +129,7 @@ static bool CGroup_filterName_internal(const char* cgroup, StrBuf_state* s, StrB if (!String_startsWith(cgroup, str_user_slice_prefix)) continue; - const char* userSliceSlash = strchrnul(cgroup + strlen(str_user_slice_prefix), '/'); + const char* userSliceSlash = String_strchrnul(cgroup + strlen(str_user_slice_prefix), '/'); const char* sliceSpec = userSliceSlash - strlen(str_slice_suffix); if (!String_startsWith(sliceSpec, str_slice_suffix)) @@ -212,7 +212,7 @@ static bool CGroup_filterName_internal(const char* cgroup, StrBuf_state* s, StrB while (*labelStart == '/') labelStart++; - nextSlash = strchrnul(labelStart, '/'); + nextSlash = String_strchrnul(labelStart, '/'); if (nextSlash - labelStart > 0) { if (!StrBuf_putsz(s, w, isMonitor ? "[LXC:" : "[lxc:")) return false; @@ -276,7 +276,7 @@ static bool CGroup_filterName_internal(const char* cgroup, StrBuf_state* s, StrB continue; } else if (Label_checkPrefix(labelStart, scopeNameLen, str_snap_scope_prefix)) { - const char* nextDot = strchrnul(labelStart + strlen(str_snap_scope_prefix), '.'); + const char* nextDot = String_strchrnul(labelStart + strlen(str_snap_scope_prefix), '.'); if (!StrBuf_putsz(s, w, "!snap:")) return false; |