diff options
author | Rob Landley <rob@landley.net> | 2013-08-27 23:48:54 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2013-08-27 23:48:54 -0500 |
commit | 455865a837f2a6c44f91e5a5a2cd40c3a64d4b68 (patch) | |
tree | 6eb787bd75914d35c7d742e02dc7be9c279d3d03 /lib/lib.c | |
parent | 8b5c671958071ee2a9967551f0490623b73e30b5 (diff) | |
download | toybox-455865a837f2a6c44f91e5a5a2cd40c3a64d4b68.tar.gz |
Rewrite pmap to be simpler and match other implementation's output more closely.
Diffstat (limited to 'lib/lib.c')
-rw-r--r-- | lib/lib.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -325,6 +325,8 @@ char *readfile(char *name) fd = open(name, O_RDONLY); if (fd == -1) return 0; len = fdlength(fd); + // proc files don't report a length, so try 1 page minimum. + if (len<4096) len = 4095; buf = xmalloc(len+1); buf[readall(fd, buf, len)] = 0; |