[Openais] Patch improved util.c/openais_exit_error

Hans Feldt Hans.Feldt at ericsson.com
Fri Sep 1 03:16:48 PDT 2006


Committed revision 1235.

Hans Feldt wrote:
> Added file and line of caller. Will be useful for troubleshooting. Uses 
> standard exit status.
> 
> Regards,
> Hans
> 
> 
> ------------------------------------------------------------------------
> 
> Index: exec/util.c
> ===================================================================
> --- exec/util.c	(revision 1229)
> +++ exec/util.c	(working copy)
> @@ -83,11 +83,13 @@
>  }
>  
>  
> -void openais_exit_error (enum e_ais_done err)
> +void _openais_exit_error (
> +	enum e_ais_done err, const char *file, unsigned int line)
>  {
> -	log_printf (LOG_LEVEL_ERROR, "AIS Executive exiting (%d).\n", err);
> +	log_printf (LOG_LEVEL_ERROR, "AIS Executive exiting with status %d at %s:%u.\n",
> +		err, file, line);
>  	log_flush();
> -	exit (err);
> +	exit (EXIT_FAILURE);
>  }
>  
>  char *getSaNameT (SaNameT *name)
> Index: exec/util.h
> ===================================================================
> --- exec/util.h	(revision 1229)
> +++ exec/util.h	(working copy)
> @@ -67,7 +67,9 @@
>   */
>  extern int name_match(SaNameT *name1, SaNameT *name2);
>  extern int mar_name_match(mar_name_t *name1, mar_name_t *name2);
> -void openais_exit_error (enum e_ais_done err);
> +#define openais_exit_error(err) _openais_exit_error ((err), __FILE__, __LINE__)
> +extern void _openais_exit_error (
> +	enum e_ais_done err, const char *file, unsigned int line);
>  extern char *getSaNameT (SaNameT *name);
>  extern char *strstr_rs (const char *haystack, const char *needle);
>  extern void setSaNameT (SaNameT *name, char *str);
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Openais mailing list
> Openais at lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/openais




More information about the Openais mailing list