Remember path (or other description) in fd's, add getter
authorPanu Matilainen <Panu Matilainen pmatilai@redhat.com>
Thu, 7 Jul 2011 12:47:47 +0000 (15:47 +0300)
committerPanu Matilainen <Panu Matilainen pmatilai@redhat.com>
Thu, 7 Jul 2011 13:31:26 +0000 (16:31 +0300)
commit63d4926bf601797cbcdf4d5d99e8db4d2530d5ef
tree63140dab7741c30dc78d93a4d251a30ecee24a40
parent3688b39cab92af6840d541c60582bd327954ff50
Remember path (or other description) in fd's, add getter

- If opened by path, we obviously want to use that. Otherwise
  generate a description lazily on first Fdescr() call: on Linux
  we can grab something relatively meaningful by looking up from /proc
  (this is why we want to be lazy here...). If that's not available
  or fails, just generate a string on the current fdno. Actual
  paths are returned as is, other descriptions are bracketed,
  (eg "[mumble 123]").
- This makes it possible to give more meaningful error messages in
  places where we only get an fd from somebody (related to RhBug:522160)
rpmio/rpmio.c
rpmio/rpmio.h