We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
sysctl: unknown oid
1 parent 4dfe254 commit 2b9619cCopy full SHA for 2b9619c
rustup-init.sh
@@ -261,11 +261,13 @@ get_architecture() {
261
# get the real answer, but that's hard to ensure, so instead we use
262
# `sysctl` (which doesn't lie) to check for the actual architecture.
263
if [ "$_cputype" = i386 ]; then
264
- if sysctl hw.optional.x86_64 | grep -q ': 1'; then
+ # Avoid `sysctl: unknown oid` stderr output and/or non-zero exit code.
265
+ if sysctl hw.optional.x86_64 2> /dev/null || true | grep -q ': 1'; then
266
_cputype=x86_64
267
fi
268
elif [ "$_cputype" = x86_64 ]; then
- if sysctl hw.optional.arm64 | grep -q ': 1'; then
269
270
+ if sysctl hw.optional.arm64 2> /dev/null || true | grep -q ': 1'; then
271
_cputype=arm64
272
273
0 commit comments