winpr_backtrace_symbols_fd ignores partial write() returns — intentional or worth fixing?
#12762
|
Building FreeRDP 3.26.0 on Ubuntu 26.04 (gcc 15.2.0, glibc 2.43), I noticed this warning in FreeRDP/winpr/libwinpr/utils/debug.c Line 163 in 1d93a2d The Looking at the code itself, there's a separate concern beyond the warning: A loop that handles partial writes would both fix the latent issue and silence the warning as a side effect. Something like: for (size_t i = 0; i < used; i++) {
const char *p = lines[i];
size_t remaining = strnlen(lines[i], LINE_LENGTH_MAX);
while (remaining > 0) {
ssize_t n = _write(fd, p, remaining);
if (n < 0) {
if (errno == EINTR) continue;
break; /* unrecoverable; give up on this line */
}
p += n;
remaining -= (size_t)n;
}
}Not blocking my build — just flagging in case it's of interest. |
@utkonos well, the function is currently unused so it did not get much attention.
long story short, pull requests always welcome.