X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcompat-smp.h;h=31fa979a7040736999823a49ca1f01b7a4d92c48;hb=HEAD;hp=7240d2f66b3c8af059338df28bc032192abdcd20;hpb=5cfe81b7ddff9543d451746de9965cac58c67182;p=urcu.git diff --git a/src/compat-smp.h b/src/compat-smp.h index 7240d2f..5da8d6a 100644 --- a/src/compat-smp.h +++ b/src/compat-smp.h @@ -1,5 +1,5 @@ /* - * SPDX-License-Identifier: LGPL-2.1-only + * SPDX-License-Identifier: MIT * * Copyright (C) 2011-2012 Mathieu Desnoyers * Copyright (C) 2019 Michael Jeanson @@ -36,6 +36,7 @@ static inline int get_num_possible_cpus_sysconf(void) } #endif +#ifdef __linux__ /* * Get the highest CPU id from sysfs. * @@ -163,7 +164,7 @@ static inline int get_cpu_mask_from_sysfs(char *buf, size_t max_bytes, const cha total_bytes_read += bytes_read; assert(total_bytes_read <= max_bytes); - } while (max_bytes > total_bytes_read && bytes_read > 0); + } while (max_bytes > total_bytes_read && bytes_read != 0); /* * Make sure the mask read is a null terminated string. @@ -235,7 +236,6 @@ error: return -1; } -#ifdef __linux__ /* * On Linux try sysfs first and fallback to sysconf. */