Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Conversation

@revl
Copy link
Contributor

@revl revl commented Apr 16, 2020

This is the 2.0 counterpart of #8959

Change Description

When called without any parameter to override the block size, /bin/df uses the $BLOCKSIZE environment variable. That variable may contain units like K, M, G, etc.

Before this commit, general.sh took the value of $BLOCKSIZE from the output of df and used it in arithmetic expressions, which broke them because of the unit suffixes.

This commit adds the highly portable -k option to the df invocation to explicitly set the value of block size to 1024.

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

When called without any parameter to override the block size, '/bin/df'
uses the $BLOCKSIZE environment variable. That variable may contain
units like K, M, G, etc.

Before this commit, general.sh took the value of $BLOCKSIZE from the
output of 'df' and used it in arithmetic expressions, which broke them
because of the unit suffixes.

This commit adds the higly portable '-k' option to the 'df' invocation
to explicitly set the value of block size to 1024.
@revl revl requested a review from scottarnette April 16, 2020 23:07
@revl revl merged commit e303192 into release/2.0.x Apr 17, 2020
@revl revl deleted the fix-df-invocation-2.0 branch April 17, 2020 15:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants