c4cd1d4d93e4a45a088edb6517555aa7e06e5f86 |
|
30-Sep-2015 |
Aaro Koskinen <aaro.koskinen@nokia.com> |
fileio: make get_status_field() more generic
All users of get_status_field() expect the field pattern to occur in
the beginning of a line, and the delimiter is ':'.
Hardcode this into the function, and also skip any whitespace before ':'
to support fields in files like /proc/cpuinfo. Add support for returning
the full field value (currently stops on first whitespace).
Rename the function so it's easier to ensure all callers switch to new
semantics. |
a644184a177caa709e1bb784e4f169101194b610 |
|
23-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
process: return ESRCH when a PID is not valid anymore
so far, when we read something from /proc/$PID we would pass on the
ENOENT from the kernel as error, if the process was missing. With this
change we systematically convert this to ESRCH, which is the more
appropriate error code, and what all the other glibc/syscalls like
kill() use.
All code that calls these functions should be fine with this change. In
fact, one invocation of get_process_exe() in bus-creds.c already assumed
ESRCH would be returned if a process is missing, and this assumption is
now validated after the change. |