Commit e0f9d19f authored by Alessandro Rubini's avatar Alessandro Rubini

tools/wrpc-dump: support /sys/*/pci/*resource0 files

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 137cf0af
...@@ -501,10 +501,12 @@ int main(int argc, char **argv) ...@@ -501,10 +501,12 @@ int main(int argc, char **argv)
exit(1); exit(1);
} }
if (!S_ISREG(st.st_mode)) { /* FIXME: support memory */ if (!S_ISREG(st.st_mode)) { /* FIXME: support memory */
fprintf(stderr, "%s: %s not a regular fule\n", fprintf(stderr, "%s: %s not a regular file\n",
argv[0], argv[1]); argv[0], argv[1]);
exit(1); exit(1);
} }
if (st.st_size > 128 * 1024) /* support /sys/..../resource0 */
st.st_size = 128 * 1024;
if (sscanf(argv[2], "%lx%c", &offset, &c) != 1) { if (sscanf(argv[2], "%lx%c", &offset, &c) != 1) {
fprintf(stderr, "%s: \"%s\" not a hex offset\n", argv[0], fprintf(stderr, "%s: \"%s\" not a hex offset\n", argv[0],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment