Also cleans up two instances of open() with useless mode params, and
changes a few uses of snprintf to use sizeof(buffer) instead of
hardcoded buffer sizes.
Change-Id: If11591003d910c995e72ad8f75afd072c255a3c5
Used to talk to kernel synchronization framework
Change-Id: I66e1f4a90f5d58d384bf1cec09db52101f182c5e
Signed-off-by: Erik Gilling <konkers@android.com>