Do dummy GPIO reads on startup

Do a read of all of the button GPIOs after they are configured
but before the sd_event handling has been set up to prevent
a spurious sd_event callback as soon as the event loop starts.

Without these, a button released signal gets sent every time
the application starts.

Tested: Saw that the spurious callbacks went away.

Change-Id: I4d2a609f58f4debdd9280244e1f839f8f891be82
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/inc/id_button.hpp b/inc/id_button.hpp
index af100ef..8116185 100644
--- a/inc/id_button.hpp
+++ b/inc/id_button.hpp
@@ -51,6 +51,9 @@
                 IOError();
         }
 
+        char buf;
+        ::read(fd, &buf, sizeof(buf));
+
         ret = sd_event_add_io(event.get(), nullptr, fd, EPOLLPRI,
                               callbackHandler, this);
         if (ret < 0)
diff --git a/inc/power_button.hpp b/inc/power_button.hpp
index ce8df46..e71d9f1 100644
--- a/inc/power_button.hpp
+++ b/inc/power_button.hpp
@@ -52,6 +52,9 @@
                 IOError();
         }
 
+        char buf;
+        ::read(fd, &buf, sizeof(buf));
+
         ret = sd_event_add_io(event.get(), nullptr, fd, EPOLLPRI,
                               callbackHandler, this);
         if (ret < 0)
diff --git a/inc/reset_button.hpp b/inc/reset_button.hpp
index d0534e8..5066bb1 100644
--- a/inc/reset_button.hpp
+++ b/inc/reset_button.hpp
@@ -51,6 +51,9 @@
                 IOError();
         }
 
+        char buf;
+        ::read(fd, &buf, sizeof(buf));
+
         ret = sd_event_add_io(event.get(), nullptr, fd, EPOLLPRI,
                               callbackHandler, this);
         if (ret < 0)