projects
/
moonshot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7a6a4f3
)
add GET_LAST_ERROR macro
author
Luke Howard
<lukeh@padl.com>
Tue, 13 Sep 2011 05:29:19 +0000
(15:29 +1000)
committer
Luke Howard
<lukeh@padl.com>
Tue, 13 Sep 2011 05:29:19 +0000
(15:29 +1000)
moonshot/mech_eap/util.h
patch
|
blob
|
history
moonshot/mech_eap/util_context.c
patch
|
blob
|
history
moonshot/mech_eap/util_cred.c
patch
|
blob
|
history
moonshot/mech_eap/util_name.c
patch
|
blob
|
history
diff --git
a/moonshot/mech_eap/util.h
b/moonshot/mech_eap/util.h
index
6fd31d7
..
5f0bc9d
100644
(file)
--- a/
moonshot/mech_eap/util.h
+++ b/
moonshot/mech_eap/util.h
@@
-776,6
+776,8
@@
verifyTokenHeader(OM_uint32 *minor,
#include <winbase.h>
#include <winbase.h>
+#define GSSEAP_GET_LAST_ERROR() (GetLastError())
+
#define GSSEAP_MUTEX CRITICAL_SECTION
#define GSSEAP_MUTEX_INIT(m) (InitializeCriticalSection((m)), 0)
#define GSSEAP_MUTEX CRITICAL_SECTION
#define GSSEAP_MUTEX_INIT(m) (InitializeCriticalSection((m)), 0)
@@
-785,10
+787,16
@@
verifyTokenHeader(OM_uint32 *minor,
/* XXX yet to implement thread-local wrappers */
/* XXX yet to implement thread-local wrappers */
+#define GSSEAP_THREAD_ONCE INIT_ONCE
+#define GSSEAP_ONCE(o, i) InitOnceExecuteOnce((o), (i))
+#define GSSEAP_ONCE_INITIALIZER INIT_ONCE_STATIC_INIT
+
#else
#include <pthread.h>
#else
#include <pthread.h>
+#define GSSEAP_GET_LAST_ERROR() (errno)
+
#define GSSEAP_MUTEX pthread_mutex_t
#define GSSEAP_MUTEX_INIT(m) pthread_mutex_init((m), NULL)
#define GSSEAP_MUTEX pthread_mutex_t
#define GSSEAP_MUTEX_INIT(m) pthread_mutex_init((m), NULL)
diff --git
a/moonshot/mech_eap/util_context.c
b/moonshot/mech_eap/util_context.c
index
80324bf
..
61b9b23
100644
(file)
--- a/
moonshot/mech_eap/util_context.c
+++ b/
moonshot/mech_eap/util_context.c
@@
-52,7
+52,7
@@
gssEapAllocContext(OM_uint32 *minor,
}
if (GSSEAP_MUTEX_INIT(&ctx->mutex) != 0) {
}
if (GSSEAP_MUTEX_INIT(&ctx->mutex) != 0) {
- *minor =
errno
;
+ *minor =
GSSEAP_GET_LAST_ERROR()
;
gssEapReleaseContext(&tmpMinor, &ctx);
return GSS_S_FAILURE;
}
gssEapReleaseContext(&tmpMinor, &ctx);
return GSS_S_FAILURE;
}
diff --git
a/moonshot/mech_eap/util_cred.c
b/moonshot/mech_eap/util_cred.c
index
0479c59
..
11dcfeb
100644
(file)
--- a/
moonshot/mech_eap/util_cred.c
+++ b/
moonshot/mech_eap/util_cred.c
@@
-57,7
+57,7
@@
gssEapAllocCred(OM_uint32 *minor, gss_cred_id_t *pCred)
}
if (GSSEAP_MUTEX_INIT(&cred->mutex) != 0) {
}
if (GSSEAP_MUTEX_INIT(&cred->mutex) != 0) {
- *minor =
errno
;
+ *minor =
GSSEAP_GET_LAST_ERROR()
;
gssEapReleaseCred(&tmpMinor, &cred);
return GSS_S_FAILURE;
}
gssEapReleaseCred(&tmpMinor, &cred);
return GSS_S_FAILURE;
}
@@
-167,7
+167,7
@@
readStaticIdentityFile(OM_uint32 *minor,
if (getpwuid_r(getuid(), &pwd, pwbuf, sizeof(pwbuf), &pw) != 0 ||
pw == NULL || pw->pw_dir == NULL) {
major = GSS_S_CRED_UNAVAIL;
if (getpwuid_r(getuid(), &pwd, pwbuf, sizeof(pwbuf), &pw) != 0 ||
pw == NULL || pw->pw_dir == NULL) {
major = GSS_S_CRED_UNAVAIL;
- *minor =
errno
;
+ *minor =
GSSEAP_GET_LAST_ERROR()
;
goto cleanup;
}
goto cleanup;
}
diff --git
a/moonshot/mech_eap/util_name.c
b/moonshot/mech_eap/util_name.c
index
e20dffd
..
f14ca4c
100644
(file)
--- a/
moonshot/mech_eap/util_name.c
+++ b/
moonshot/mech_eap/util_name.c
@@
-81,7
+81,7
@@
gssEapAllocName(OM_uint32 *minor, gss_name_t *pName)
}
if (GSSEAP_MUTEX_INIT(&name->mutex) != 0) {
}
if (GSSEAP_MUTEX_INIT(&name->mutex) != 0) {
- *minor =
errno
;
+ *minor =
GSSEAP_GET_LAST_ERROR()
;
gssEapReleaseName(&tmpMinor, &name);
return GSS_S_FAILURE;
}
gssEapReleaseName(&tmpMinor, &name);
return GSS_S_FAILURE;
}