SAMD/L21: Need to preserve errno value across syslog() call.

This commit is contained in:
Gregory Nutt 2017-07-12 16:22:23 -06:00
parent 0d08ce500e
commit 447785b264

View File

@ -625,8 +625,9 @@ static int i2c_wait_for_bus(struct sam_i2c_dev_s *priv, unsigned int size)
if (sem_timedwait(&priv->waitsem, (const struct timespec *)&ts) != OK)
{
i2cinfo("timedwait error %d\n", errno);
return -errno;
int errcode = errno;
i2cinfo("timedwait error %d\n", errcode);
return -errcode;
}
return priv->result;