lsdvb crashes if device is in use
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| linuxtv-dvb-apps (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Bug Description
lsdvb crashes if the device is in use (for example by tvheadend). Problem is the file mode. `O_RDWR` is not needed, `O_RDONLY` is enough.
Original output (actual):
```
$ lsdvb
em28xx (632515409:0 0:1) on PCI Domain:31888 Bus:-818575984 Device:31888 Function:-818390219
DEVICE:0 ADAPTER:0 ERROR: Open frontend0 failed
```
Expected output (with patch):
```
$ lsdvb
em28xx (-633244093:0 0:1) on PCI Domain:32354 Bus:-2121079408 Device:32354 Function:
DEVICE:0 ADAPTER:0 FRONTEND:0 (Silicon Labs Si2168)
DEVICE:0 ADAPTER:1 FRONTEND:0 (Silicon Labs Si2168)
```
patch:
```
--- linuxtv-
+++ linuxtv-
@@ -290,7 +290,7 @@
get_
sprintf(fedev, "%s/adapter%d/%s", DVB_DIR, adapter, frontend);
- fd = open(fedev, O_RDWR | O_NONBLOCK);
+ fd = open(fedev, O_RDONLY | O_NONBLOCK);
if (fd < 0) {
fprintf(
return -1;
```
Ubuntu 24.04,
Package: dvb-apps
Architecture: amd64
Version: 1.1.1+rev1500-

btw the pci device information also looks weird (note the big and negative numbers). in my case, its two usb devices with the same driver