This one uses _dbus_read() instead of plain read. It's also tempting to fold the logic from the last `else' statement into the first one. And even further the logic that closes the file (and reverts the output DBusString size) and returns the status could also be folded. This will require writing some tests for this function first.
Created attachment 75714 get_contents( ) to support procfs files that appear to be empty
A patch for _dbus_file_
This is the first patch in hopefully a series of patches that will try to remedy the problem described in this bug at least on Linux.
First thing to do is to support files in procfs that appear to be empty. Unfortunately _dbus_file_ get_contents( ) ignores such files upfront.
The patch has been inspired by a patch used in a production system: /github. com/kkonopko/ dbus/commit/ 7af563d558808fc 91d181b5bf9fe24 543a44df4c# L8R148
https:/
This one uses _dbus_read() instead of plain read. It's also tempting to fold the logic from the last `else' statement into the first one. And even further the logic that closes the file (and reverts the output DBusString size) and returns the status could also be folded. This will require writing some tests for this function first.
The patch is to get a brief opinion and views.