beagleboard / am335x_pru_package

332 stars 181 forks source link

Fixed bug which caused prussdrv_open() to fail if file descriptor = 0 #68

Open VedantParanjape opened 4 years ago

VedantParanjape commented 4 years ago

Fixes issue #44

hzeller commented 2 years ago

This solution looks like a hack to me: now we open an unnecesary file and worse have to open the same uio file again, just so that we don't run into a file descriptor that happens to be the sentinel.

What needs to happen is that internally the sentinel value is changed to something outside the range of valid file descriptors (e.g. negative numbers).