Browse Source

net/slirp: Improve file open error message

This error reports failure to create a temporary file, and
error_setg_file_open() would probably be too terse, so merely switch
to error_setg_errno() to add errno information.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20251121121438.1249498-12-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
pull/316/head
Markus Armbruster 9 months ago
parent
commit
42cfc68b0e
  1. 4
      net/slirp.c

4
net/slirp.c

@ -1034,8 +1034,10 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
f = fopen(smb_conf, "w");
if (!f) {
int eno = errno;
slirp_smb_cleanup(s);
error_setg(errp,
error_setg_errno(errp, eno,
"Could not create samba server configuration file '%s'",
smb_conf);
g_free(smb_conf);

Loading…
Cancel
Save