diff options
| author | Tejun Heo <tj@kernel.org> | 2026-03-06 07:46:32 -1000 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-03-06 07:46:32 -1000 |
| commit | 32e940f2bd3b16551f23ea44be47f6f5d1746d64 (patch) | |
| tree | 23037a80fd683ff1a52ca05e2d7432c0cbc8f98b /tools/sched_ext/include/scx | |
| parent | 477174ac35c510d0ed3043f5bd4fba25546a21ce (diff) | |
| parent | 1dde502587657045b267f179d7a1ecc7b8a1a265 (diff) | |
Merge branch 'for-7.0-fixes' into for-7.1
To prepare for hierarchical scheduling patchset which will cause multiple
conflicts otherwise.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/sched_ext/include/scx')
| -rw-r--r-- | tools/sched_ext/include/scx/compat.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/sched_ext/include/scx/compat.h b/tools/sched_ext/include/scx/compat.h index 8b4897fc8b99..edccc99c7294 100644 --- a/tools/sched_ext/include/scx/compat.h +++ b/tools/sched_ext/include/scx/compat.h @@ -125,6 +125,7 @@ static inline long scx_hotplug_seq(void) { int fd; char buf[32]; + char *endptr; ssize_t len; long val; @@ -137,8 +138,10 @@ static inline long scx_hotplug_seq(void) buf[len] = 0; close(fd); - val = strtoul(buf, NULL, 10); - SCX_BUG_ON(val < 0, "invalid num hotplug events: %lu", val); + errno = 0; + val = strtoul(buf, &endptr, 10); + SCX_BUG_ON(errno == ERANGE || endptr == buf || + (*endptr != '\n' && *endptr != '\0'), "invalid num hotplug events: %ld", val); return val; } |
