Fix bogus argument validation
* The comparaison couldn't ever not match. Based on the comment above the function, I made it so that flags must contain at least one of B_WATCH_NAME, B_WATCH_STAT or B_WATCH_ATTR CID 2586
This commit is contained in:
@@ -38,8 +38,8 @@
|
|||||||
status_t
|
status_t
|
||||||
watch_volume(dev_t volume, uint32 flags, BMessenger target)
|
watch_volume(dev_t volume, uint32 flags, BMessenger target)
|
||||||
{
|
{
|
||||||
if ((flags | B_WATCH_NAME) == 0 && (flags | B_WATCH_STAT)
|
if ((flags & B_WATCH_NAME) == 0 && (flags & B_WATCH_STAT) == 0
|
||||||
&& (flags | B_WATCH_ATTR))
|
&& (flags & B_WATCH_ATTR) == 0)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
flags |= B_WATCH_VOLUME;
|
flags |= B_WATCH_VOLUME;
|
||||||
|
|||||||
Reference in New Issue
Block a user