Fix simple mistake

This commit is contained in:
HansHoogerwerf 2022-10-17 16:24:59 +02:00 committed by GitHub
parent 98ac5a562a
commit ff26dca83a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2562,17 +2562,19 @@
GetTimestamp() { GetTimestamp() {
ts=0 ts=0
# Detect if the implementation of date supports nanoseconds, # Detect if the implementation of date supports nanoseconds,
if [ "${OS}" = "Linux" ]; then if [ "${OS}" = "Linux" ]; then
current_nanoseconds=$(date "+%N") current_nanoseconds=$(date "+%N")
# Verify if the result of the command is a number # Verify if the result of the command is a number
if [ -n "$current_nanoseconds" ] && [ "$current_nanoseconds" -eq "$current_nanoseconds" ] 2>/dev/null; then if [ -n "$current_nanoseconds" ] && [ "$current_nanoseconds" -eq "$current_nanoseconds" ] 2>/dev/null; then
ts=$(date "+%s%N") ts=$(date "+%s%N")
else else
ts=$(date "+%s") ts=$(date "+%s")
fi fi
else
ts=$(date "+%s")
fi fi
echo $ts echo $ts
} }
Register() { Register() {