Further encancements

Fix a bug with ret being used to count poll events and also as an error
code for nl_recvmsgs_default.

Make handle_device_event return int.

Add a comment to explain our pollfds.

Signed-off-by: Andy Grover <agrover@redhat.com>
Move event polling stuff to its own function

And properly free calloc'd memory.

Signed-off-by: Andy Grover <agrover@redhat.com>
Make add_device and remove_device

Get size of mmap from sysfs.

Signed-off-by: Andy Grover <agrover@redhat.com>
Hook-up netlink notifiers to add_device and remove_device

Signed-off-by: Andy Grover <agrover@redhat.com>
Combine netlink handlers into a single function

No shorter, but a little less duplication.

Signed-off-by: Andy Grover <agrover@redhat.com>