riscvarchive / riscv-indirect-csr-access

Smcsrind/Sscsrind is an ISA extension that extends the indirect CSR access mechanism originally defined as part of the Smaia/Ssaia extensions, in order to make it available for use by other extensions without creating an unnecessary dependence on Smaia/Ssaia.
https://jira.riscv.org/browse/RVG-59
Creative Commons Attribution 4.0 International
3 stars 1 forks source link

Detect Docker robustly #3

Open a4lg opened 1 year ago

a4lg commented 1 year ago

&> /dev/null works as a redirection from stdout and stderr to /dev/null in Bash but not in POSIX shell (considered as an asynchronous execution and the result of the command command cannot be retrieved).

As a result, it always assumes that Docker always exists.

This commit makes the redirection robust and portable (uses >/dev/null 2>&1 instead, makes it possible to detect "no Docker" condition correctly).

This is a port of now merged riscv/docs-spec-template#14.