Minor change to last PR: errno should not be modified if no error occurred.

This commit is contained in:
Gregory Nutt 2017-08-07 06:33:53 -06:00
parent 1dfed49a3c
commit baf4c0d011

View File

@ -156,8 +156,14 @@ int sched_setaffinity(pid_t pid, size_t cpusetsize, FAR const cpu_set_t *mask)
errout_with_csection: errout_with_csection:
leave_critical_section(flags); leave_critical_section(flags);
errout_with_lock: errout_with_lock:
sched_unlock(); sched_unlock();
if (errcode != 0)
{
set_errno(errcode); set_errno(errcode);
return errcode ? ERROR : OK; return ERROR;
}
return OK;
} }