aboutsummaryrefslogtreecommitdiffstats
path: root/coreupdown.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-02-22 13:18:45 +0100
committerMattias Andrée <m@maandree.se>2026-02-22 13:18:45 +0100
commite2d80d2da476f583b77d793bcbf23b59a5d1266e (patch)
tree7269993fa263a83538375c8769956e426a742d16 /coreupdown.c
parentUpdate e-mail (diff)
downloadcoreupdown-e2d80d2da476f583b77d793bcbf23b59a5d1266e.tar.gz
coreupdown-e2d80d2da476f583b77d793bcbf23b59a5d1266e.tar.bz2
coreupdown-e2d80d2da476f583b77d793bcbf23b59a5d1266e.tar.xz
misc fixesHEAD1.1.1master
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'coreupdown.c')
-rw-r--r--coreupdown.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/coreupdown.c b/coreupdown.c
index 283a1de..ba80758 100644
--- a/coreupdown.c
+++ b/coreupdown.c
@@ -30,7 +30,7 @@ coreupdown(unsigned long int count, const char *postcommand)
int fd, have_success = 0, have_failure = 0;
for (i = 1; i; i++) {
- sprintf(path, "/sys/devices/system/cpu/cpu%zu/online", i);
+ sprintf(path, "/sys/devices/system/cpu/cpu%lu/online", i);
fd = open(path, O_WRONLY);
if (fd < 0) {
if (errno == ENOENT)
@@ -337,7 +337,7 @@ writefile(const char *path, const char *data, size_t len)
exit(1);
}
- for (off = 0; off < len; off++) {
+ for (off = 0; off < len;) {
r = write(fd, &data[off], len - off);
if (r < 0) {
if (errno == EINTR)