summaryrefslogtreecommitdiff
path: root/src/pal
diff options
context:
space:
mode:
authorhelloguo <xiangyang.guo@intel.com>2017-07-10 02:50:28 -0700
committerhelloguo <xiangyang.guo@intel.com>2017-07-10 02:59:58 -0700
commit48783500dd56a38820043ab40364eecbef57aae4 (patch)
treea9ac676be140327ba371acfeed1911e8eb72049f /src/pal
parent74a3f9691e490e9732da55c46b678159c64fae74 (diff)
downloadcoreclr-48783500dd56a38820043ab40364eecbef57aae4.tar.gz
coreclr-48783500dd56a38820043ab40364eecbef57aae4.tar.bz2
coreclr-48783500dd56a38820043ab40364eecbef57aae4.zip
fix error handle
Diffstat (limited to 'src/pal')
-rw-r--r--src/pal/src/numa/numa.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/pal/src/numa/numa.cpp b/src/pal/src/numa/numa.cpp
index 046f847105..5a4ba02924 100644
--- a/src/pal/src/numa/numa.cpp
+++ b/src/pal/src/numa/numa.cpp
@@ -557,20 +557,20 @@ SetThreadGroupAffinity(
int st = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuSet);
- if (st == -1)
+ if (st != 0)
{
- switch (errno)
+ switch (st)
{
- case EINVAL:
- // There is no processor in the mask that is allowed to execute the process
- SetLastError(ERROR_INVALID_PARAMETER);
- break;
- case EPERM:
- SetLastError(ERROR_ACCESS_DENIED);
- break;
- default:
- SetLastError(ERROR_GEN_FAILURE);
- break;
+ case EINVAL:
+ // There is no processor in the mask that is allowed to execute the process
+ SetLastError(ERROR_INVALID_PARAMETER);
+ break;
+ case ESRCH:
+ SetLastError(ERROR_INVALID_HANDLE);
+ break;
+ default:
+ SetLastError(ERROR_GEN_FAILURE);
+ break;
}
}