cpufetch: update to 1.07.#60446
Conversation
| if ((ret = pthread_attr_setaffinity_np(&attr, sizeof(cpu_set_t), &cpus)) != 0) { | ||
| printErr("pthread_attr_setaffinity_np: %s", strerror(ret)); | ||
| +#else | ||
| + if ((ret = pthread_setaffinity_np(*compute_th, sizeof(cpu_set_t), &cpus)) != 0) { |
There was a problem hiding this comment.
This patch looks wrong. compute_th is an array in this is inside the loop *compute_th is always just the first thread.
There was a problem hiding this comment.
Not even sure if that would even work if corrected, since you point it at a thread that does not exist yet, and memory that is not initialized.
There was a problem hiding this comment.
The alpine patch also looks wrong, it passes pthread_attr_t to pthread_setaffinity_np https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/testing/cpufetch/0001-src-x86-freq-freq.c-pthread_attr_setaffinity_np-is-n.patch
There was a problem hiding this comment.
Maybe we should disallow builds on musl platforms? Since this is some kind of GNU magic that doesn't exist on musl.
It could be running fine with the Alpine patch tho, I don't see any bug reports about it on Alpine gitlab.
Testing the changes
Local build testing