Skip to content

Commit

Permalink
fix uninitialised variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rfm committed May 26, 2024
1 parent f29c24e commit 1e0023d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions Source/GSSocketStream.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ + (void) tune: (void*)handle with: (id)opts
* that multiple processes can serve the same port simultaneously.
* We don't want that broken behavior!
*/
value = 1;
if (setsockopt(desc, SOL_SOCKET, SO_REUSEADDR, (char*)&value, sizeof(value))
< 0)
{
Expand Down
7 changes: 5 additions & 2 deletions Source/NSFileManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ + (NSEnumerator*) enumeratorFor: (NSDictionary*)d;
@end


gs_thread_key_t thread_last_error_key;
static gs_thread_key_t thread_last_error_key;

static void GS_WINAPI
exitedThread(void *lastErrorPtr)
Expand Down Expand Up @@ -379,7 +379,10 @@ + (void) initialize
{
defaultEncoding = [NSString defaultCStringEncoding];
GSAttrDictionaryClass = [GSAttrDictionary class];
GS_THREAD_KEY_INIT(thread_last_error_key, exitedThread);
if (!GS_THREAD_KEY_INIT(thread_last_error_key, exitedThread))
{
NSLog(@"Problem initialising thread error key");
}
}

- (void) dealloc
Expand Down

0 comments on commit 1e0023d

Please sign in to comment.