[2578] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

Re: [PATCH] Don't try to load default subs if zephyr has not been initialized yet.

daemon@ATHENA.MIT.EDU (Nelson Elhage)
Wed Aug 4 12:30:45 2010

From: Nelson Elhage <nelhage@MIT.EDU>
To: "Alejandro R." =?utf-8?Q?Sede=C3=B1o?= <asedeno@mit.edu>,
        barnowl-dev@mit.edu
In-Reply-To: <1280873057-20685-1-git-send-email-asedeno@mit.edu>
Date: Wed, 04 Aug 2010 12:30:34 -0400

I'm confused. Don't we only call that function from
owl_zephyr_load_initial_subs, which is called from
owl_zephyr_finish_initialization, which does
owl_global_set_havezephyr(&g); immediately before the call?

How can this get called when we don't have Zephyr initialized?

- Nelson

On Tue,  3 Aug 2010 18:04:17 -0400, Alejandro R. Sede=C3=B1o <asedeno@MIT.E=
DU> wrote:
> Signed-off-by: Alejandro R. Sede=C3=B1o <asedeno@mit.edu>
> ---
>  zephyr.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
>=20
> diff --git a/zephyr.c b/zephyr.c
> index 4dead4a..8277c18 100644
> --- a/zephyr.c
> +++ b/zephyr.c
> @@ -354,11 +354,13 @@ int owl_zephyr_loadbarnowldefaultsubs(void)
>  int owl_zephyr_loaddefaultsubs(void)
>  {
>  #ifdef HAVE_LIBZEPHYR
> -  ZSubscription_t subs[10];
> +  if (owl_global_is_havezephyr(&g)) {
> +    ZSubscription_t subs[10];
>=20=20=20=20=20=20
> -  if (ZSubscribeTo(subs,0,0) !=3D ZERR_NONE) {
> -    owl_function_error("Error subscribing to default zephyr notification=
s.");
> -    return(-1);
> +    if (ZSubscribeTo(subs,0,0) !=3D ZERR_NONE) {
> +      owl_function_error("Error subscribing to default zephyr notificati=
ons.");
> +      return(-1);
> +    }
>    }
>    return(0);
>  #else
> --=20
> 1.7.2.1
>=20
>=20

home help back first fref pref prev next nref lref last post