The ->send method is expected to set errno. We didn't set it explicitly before, although it was usually set implicitly. Let's improve this. Firstly never lose the real error message (from gnutls) so always call nbdkit_error (... gnutls_strerror ...) along error paths, even though that sometimes means we'll get double errors because the caller will also call nbdkit_error (... "%m" ...). Secondly make sure errno is set to something on error. Surround each gnutls call with errno = 0; ... if (errno == 0) errno = EIO. This means we'll capture the underlying syscall error if there was one, but if there wasn't one then we'll always return with errno set on error paths out of the function.
45b72f5