Revision 1f45a81b
b/usb-linux.c | ||
---|---|---|
1158 | 1158 |
return 0; |
1159 | 1159 |
|
1160 | 1160 |
fail: |
1161 |
dev->fd = -1;
|
|
1162 |
if (fd != -1) {
|
|
1163 |
close(fd);
|
|
1161 |
if (dev->fd != -1) {
|
|
1162 |
close(dev->fd);
|
|
1163 |
dev->fd = -1;
|
|
1164 | 1164 |
} |
1165 | 1165 |
return -1; |
1166 | 1166 |
} |
... | ... | |
1169 | 1169 |
{ |
1170 | 1170 |
int i; |
1171 | 1171 |
|
1172 |
if (dev->fd == -1) { |
|
1172 |
if (dev->fd == -1 || !dev->dev.attached) {
|
|
1173 | 1173 |
return -1; |
1174 | 1174 |
} |
1175 | 1175 |
|
Also available in: Unified diff