berkus/dir_monitor — pull request #4 by obaskanderi (2014-11-03 06:06:08+00:00)
Title: Do not create an FSEventStream if there are no directories to monitor

Test case on OSX:
1.Add a directory to dir_monitor
2.Remove the directory added above from dir_monitor

Result:
FSEventStreamCreate because cannot allocate an array of size 0

Patch:
If there are no directories to monitor then don't bother creating the FSEventsStream.
Also fsevents_ must to be nulled to ensure the when fsevents_stop() is called it will only unsubscribe from a stream that was properly created.