Subject: Re: libssh2 master d002839... Fix namespace pollution.

Re: libssh2 master d002839... Fix namespace pollution.

From: Simon Josefsson <simon_at_josefsson.org>
Date: Sun, 21 Mar 2010 19:40:47 +0100

Peter Stuge <peter_at_stuge.se> writes:

> libssh2_at_git.stuge.se wrote:
>> +++ b/src/global.c
>> @@ -37,12 +37,12 @@
>>
>> #include "libssh2_priv.h"
>>
>> -int libssh2_initialized = 0;
>> -int libssh2_init_flags = 0;
>> +static int _libssh2_initialized = 0;
>> +static int _libssh2_init_flags = 0;
>>
>> LIBSSH2_API int libssh2_init(int flags)
>> {
>> - if (!(flags & LIBSSH2_INIT_NO_CRYPTO_INIT)) {
>> + if (libssh2_initialized == 0 && !(flags & LIBSSH2_INIT_NO_CRYPTO_INIT)) {
>> libssh2_crypto_init();
>> }
>>
>> @@ -57,11 +57,18 @@ LIBSSH2_API void libssh2_exit()
>> if (libssh2_initialized == 0)
>> return;
>>
>> + libssh2_initialized--;
>
> Shouldn't these two uses of the variable be changed? Maybe there are
> other places too?

I fixed it shortly after committing that, I think.

/Simon
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-03-21