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:
Philippe Saint-Pierre
2011-11-27 13:24:43 -05:00
parent b21c95d4f6
commit 8e844f63e9
+2 -2
View File
@@ -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;