]>
Commit | Line | Data |
---|---|---|
2aa7d974 JR |
1 | --- rpm-4.16.0/rpmio/rpmio.c~ 2020-08-27 15:13:08.000000000 +0200 |
2 | +++ rpm-4.16.0/rpmio/rpmio.c 2020-11-08 21:31:26.311430982 +0100 | |
3 | @@ -1709,6 +1709,22 @@ | |
4 | } | |
5 | b[blen] = '\0'; | |
6 | } | |
7 | +#if defined(__linux__) | |
8 | + /* XXX st->st_size = 0 for /proc files on linux, see stat(2). */ | |
9 | + /* XXX glibc mmap'd libio no workie for /proc files on linux?!? */ | |
10 | + else if (!strncmp(fn, "/proc/", sizeof("/proc/")-1)) { | |
11 | + blen = blenmax; | |
12 | + b = xmalloc(blen+1); | |
13 | + b[0] = '\0'; | |
14 | + | |
15 | + size = read(Fileno(fd), b, blen); | |
16 | + if (size < 0) { | |
17 | + rc = 1; | |
18 | + goto exit; | |
19 | + } | |
20 | + blen = size; | |
21 | + } | |
22 | +#endif | |
23 | ||
24 | exit: | |
25 | if (fd) (void) Fclose(fd); |