From: Markus Armbruster <[email protected]>
The error message changes from
open FILENAME failed
to
Could not create 'FILENAME': REASON
where REASON is the value of strerror(errno).
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
hw/usb/bus.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 8dd2ce415eb..714e33989f4 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -259,10 +259,9 @@ static void usb_qdev_realize(DeviceState *qdev, Error
**errp)
}
if (dev->pcap_filename) {
- int fd = qemu_open_old(dev->pcap_filename,
- O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0666);
+ int fd = qemu_create(dev->pcap_filename,
+ O_WRONLY | O_TRUNC | O_BINARY, 0666, errp);
if (fd < 0) {
- error_setg(errp, "open %s failed", dev->pcap_filename);
usb_qdev_unrealize(qdev);
return;
}
--
2.51.0