Change use of error numbers to errno

The errno constants are more readble in the code.

Change-Id: I6cb4b61f4cf59f50969a7fc27cad35d9c90755f8