Skip to content

Commit

Permalink
Bump max buffer size to 1024kb to handle larger mountinfo files
Browse files Browse the repository at this point in the history
Signed-off-by: anguswilliams <anguswilliams@gmail.com>
  • Loading branch information
anguswilliams committed Jun 20, 2022
1 parent 4ba3093 commit 08d83cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/util/readfile.go
Expand Up @@ -21,10 +21,10 @@ import (
// ReadFileNoStat uses io.ReadAll to read contents of entire file.
// This is similar to os.ReadFile but without the call to os.Stat, because
// many files in /proc and /sys report incorrect file sizes (either 0 or 4096).
// Reads a max file size of 512kB. For files larger than this, a scanner
// Reads a max file size of 1024kB. For files larger than this, a scanner
// should be used.
func ReadFileNoStat(filename string) ([]byte, error) {
const maxBufferSize = 1024 * 512
const maxBufferSize = 1024 * 1024

f, err := os.Open(filename)
if err != nil {
Expand Down

0 comments on commit 08d83cd

Please sign in to comment.