krb5 commit: Fix windows build
Benjamin Kaduk
kaduk at MIT.EDU
Thu May 16 17:41:29 EDT 2013
https://github.com/krb5/krb5/commit/30dd0b1de11a3cd616c3223c6a780a3c3d1eb78e
commit 30dd0b1de11a3cd616c3223c6a780a3c3d1eb78e
Author: Ben Kaduk <kaduk at mit.edu>
Date: Thu May 16 16:06:51 2013 -0400
Fix windows build
Catch a few stragglers that missed the memo that k5_mutex_lock
cannot fail, and sprinkle some cc-int.h as needed.
src/ccapi/lib/ccapi_context_change_time.c | 29 ++++++++++-------------------
src/lib/krb5/ccache/ccapi/stdcc.h | 1 +
src/lib/krb5/os/ccdefname.c | 1 +
3 files changed, 12 insertions(+), 19 deletions(-)
diff --git a/src/ccapi/lib/ccapi_context_change_time.c b/src/ccapi/lib/ccapi_context_change_time.c
index 3486c46..ec6b955 100644
--- a/src/ccapi/lib/ccapi_context_change_time.c
+++ b/src/ccapi/lib/ccapi_context_change_time.c
@@ -114,12 +114,10 @@ cc_int32 cci_context_change_time_get (cc_time_t *out_change_time)
{
cc_int32 err = ccNoError;
- err = k5_mutex_lock (&g_change_time_mutex);
+ k5_mutex_lock (&g_change_time_mutex);
- if (!err) {
- *out_change_time = g_change_time + g_change_time_offset;
- k5_mutex_unlock (&g_change_time_mutex);
- }
+ *out_change_time = g_change_time + g_change_time_offset;
+ k5_mutex_unlock (&g_change_time_mutex);
return err;
}
@@ -130,11 +128,9 @@ cc_int32 cci_context_change_time_update (cci_identifier_t in_identifier,
cc_time_t in_new_change_time)
{
cc_int32 err = ccNoError;
- cc_int32 lock_err = err = k5_mutex_lock (&g_change_time_mutex);
+ k5_mutex_lock (&g_change_time_mutex);
- if (!err) {
- if (!in_identifier) { err = cci_check_error (err); }
- }
+ if (!in_identifier) { err = cci_check_error (err); }
if (!err) {
if (g_change_time < in_new_change_time) {
@@ -150,9 +146,7 @@ cc_int32 cci_context_change_time_update (cci_identifier_t in_identifier,
NULL, NULL, NULL);
}
- if (!lock_err) {
- k5_mutex_unlock (&g_change_time_mutex);
- }
+ k5_mutex_unlock (&g_change_time_mutex);
return err;
}
@@ -162,14 +156,13 @@ cc_int32 cci_context_change_time_update (cci_identifier_t in_identifier,
cc_int32 cci_context_change_time_sync (cci_identifier_t in_new_identifier)
{
cc_int32 err = ccNoError;
- cc_int32 lock_err = err = k5_mutex_lock (&g_change_time_mutex);
cc_uint32 server_ids_match = 0;
cc_uint32 server_was_running = 0;
cc_uint32 server_is_running = 0;
- if (!err) {
- if (!in_new_identifier) { err = cci_check_error (err); }
- }
+ k5_mutex_lock (&g_change_time_mutex);
+
+ if (!in_new_identifier) { err = cci_check_error (err); }
if (!err) {
err = cci_context_change_time_update_identifier (in_new_identifier,
@@ -200,9 +193,7 @@ cc_int32 cci_context_change_time_sync (cci_identifier_t in_new_identifier)
g_change_time, g_change_time_offset);
}
- if (!lock_err) {
- k5_mutex_unlock (&g_change_time_mutex);
- }
+ k5_mutex_unlock (&g_change_time_mutex);
return err;
}
diff --git a/src/lib/krb5/ccache/ccapi/stdcc.h b/src/lib/krb5/ccache/ccapi/stdcc.h
index 7519891..1955b4f 100644
--- a/src/lib/krb5/ccache/ccapi/stdcc.h
+++ b/src/lib/krb5/ccache/ccapi/stdcc.h
@@ -5,6 +5,7 @@
#if defined(_WIN32) || defined(USE_CCAPI)
#include "k5-int.h" /* loads krb5.h */
+#include "../cc-int.h"
#ifdef USE_CCAPI_V3
#include <CredentialsCache.h>
diff --git a/src/lib/krb5/os/ccdefname.c b/src/lib/krb5/os/ccdefname.c
index a2d549d..e5cb3e4 100644
--- a/src/lib/krb5/os/ccdefname.c
+++ b/src/lib/krb5/os/ccdefname.c
@@ -26,6 +26,7 @@
#define NEED_WINDOWS
#include "k5-int.h"
+#include "../ccache/cc-int.h"
#include "os-proto.h"
#include <stdio.h>
More information about the cvs-krb5
mailing list