mirror of https://github.com/nirenjan/libx52.git
Set debug output to be line buffered
The stub libusb library used for testing writes the control request to a dump file. By default, this file is block-buffered, and on a typical Linux system, it waits until it receives about a page worth of data before flushing it to disk. This results in a delay in monitoring packets when running a debug program. This change makes the file line-buffered instead, which results in the debug output for every single packet getting flushed to disk without having to wait for a full page of data.debian-packaging
parent
40b2e9bdac
commit
a7caba19df
|
@ -240,6 +240,8 @@ int libusb_open(libusb_device *dev, libusb_device_handle **handle)
|
||||||
free(tmp_hdl);
|
free(tmp_hdl);
|
||||||
return LIBUSB_ERROR_IO;
|
return LIBUSB_ERROR_IO;
|
||||||
}
|
}
|
||||||
|
/* Set the packet data file to be line buffered */
|
||||||
|
setlinebuf(tmp_hdl->packet_data_file);
|
||||||
|
|
||||||
LIBUSB_DUMP_LOG_FILE(tmp_hdl, LIBUSB_LOG_LEVEL_DEBUG,
|
LIBUSB_DUMP_LOG_FILE(tmp_hdl, LIBUSB_LOG_LEVEL_DEBUG,
|
||||||
"VID: %04x PID: %04x idx: %d ref: %d\n",
|
"VID: %04x PID: %04x idx: %d ref: %d\n",
|
||||||
|
|
Loading…
Reference in New Issue