After 'errno' management was standardized, a couple of
fields were added to the <pids> api. Only 1 (PIDS_EXE)
involved dynamic memory and, unfortunately, it did not
conform to that expected normalized ENOMEM convention.
Reference(s):
. Jun 2018, added 'exe' to library
commit
ad4269f1189d5a7d68765e291bcfa981b6731c25
. Nov 2017, standardized 'errno' management
commit
06be33b43e5ff3f2658e77ef79441ac2e970cfd7
Signed-off-by: Jim Warner <james.warner@comcast.net>
if (flags & PROC_FILL_LUID) // value the login user id
p->luid = login_uid(path);
- if (flags & PROC_FILL_EXE)
- p->exe = readlink_exe(path);
+ if (flags & PROC_FILL_EXE) {
+ if (!(p->exe = readlink_exe(path)))
+ rc += 1;
+ }
if (rc == 0) return p;
errno = ENOMEM;
if (flags & PROC_FILLSYSTEMD) // get sd-login.h stuff
rc += sd2proc(t);
- if (flags & PROC_FILL_EXE)
- t->exe = readlink_exe(path);
+ if (flags & PROC_FILL_EXE) {
+ if (!(t->exe = readlink_exe(path)))
+ rc += 1;
+ }
#ifdef FALSE_THREADS
}
#endif