Commit db0e182
committed
Fix bugs in sync library error handling
fnusb_open_subdevices checked for camera==NULL or res < 0 before
jumping to the failure case. If camera was NULL but res was not
0, the function would return 0 indicating success. This occurs
when a kinect is not plugged into the PC. Forcing res to be
negative when the camera == NULL case allows the failure to open
a device to propagate through an application.
alloc_kinect in freenect_sync has a check for if freenect_open_device
fails, but the logic is incorrect. freenect_open_device returns 0 on
success and < 0 on error, so adding a check to see if the return is
< 0 corrects detection of the failure case.
Signed-off-by: Rich Mattes <[email protected]>1 parent 9e98a0b commit db0e182
2 files changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
468 | 469 | | |
469 | 470 | | |
470 | 471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| |||
0 commit comments