7seg: modify the file operation

Open the file descriptor in main() and close the file descriptor only
when the program is about to terminate. Closing the file descriptor at
DisplayDbusValue() in 7seg.cpp will make the program using poll() to
receive POST codes always return the POLLHUP and the poll() is not
actually blocked, which makes the program always preempt the CPU. This
modification prevents the user space program recieving POST codes via
poll() from preempting the CPU too much time.

Tested: using `top` to inspect whether the program receiving POST codes
from 7seg.cpp does not preempt the CPU resources.

Signed-off-by: wukaihua-fii-na <eason.kh.wu@fii-na.com>
Change-Id: I0824727d8cb207c1622da12ac833a089a676661e
3 files changed
tree: ca25eb78ca347ccb8f1ba1b834aa933539ff0825
  1. ipmisnoop/
  2. lpcsnoop/
  3. subprojects/
  4. test/
  5. .clang-format
  6. .gitignore
  7. 7seg.cpp
  8. 80-7seg.rules
  9. example.cpp
  10. LICENSE
  11. lpcsnoop.service.in
  12. main.cpp
  13. MAINTAINERS
  14. meson.build
  15. meson_options.txt
  16. OWNERS
  17. postcode-7seg@.service
  18. README.md
README.md

LPC Snoop Broadcast Daemon

This is a simple daemon which reads a file interface from an lpc-snoop driver and broadcasts the values read on DBus.