Seek to file offset 0 after reading error file

For a fd watching for data in sysfs file, a poll would return
immediately after read unless file is closed and re-opened OR
stream is seeked to 0. This commit chooses latter.

From stackoverflow:

Once poll/select indicates that the value has changed, you need to close and
re-open the file, or seek to 0 and read again.

Also, use EPOLLPRI | EPOLLERR than EPOLLIN as needed by sysfs_inotify

Change-Id: I243cdfd9a09c567eac5e52abd9980ebf90b94f89
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
1 file changed