diff options
| author | Mattias Andrée <m@maandree.se> | 2026-02-22 13:18:45 +0100 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-02-22 13:18:45 +0100 |
| commit | e2d80d2da476f583b77d793bcbf23b59a5d1266e (patch) | |
| tree | 7269993fa263a83538375c8769956e426a742d16 /coreupdown.c | |
| parent | Update e-mail (diff) | |
| download | coreupdown-e2d80d2da476f583b77d793bcbf23b59a5d1266e.tar.gz coreupdown-e2d80d2da476f583b77d793bcbf23b59a5d1266e.tar.bz2 coreupdown-e2d80d2da476f583b77d793bcbf23b59a5d1266e.tar.xz | |
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'coreupdown.c')
| -rw-r--r-- | coreupdown.c | 4 |
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) |
