source: branches/stable/mondo/src/lib/mr_err.c @ 1264

Last change on this file since 1264 was 1264, checked in by Bruno Cornec, 13 years ago
  • mr_exit used instead of exit
  • mr_rs_clean_conf/mr_rs_cleanup/mr_ar_clean_conf/mr_ar_cleanup added
  • compiltaion warnings suppressed
  • Addition of mr_types (for boolean with typedef)
  • struct mr_rs_conf added
  • help_screen removed (useless)
  • Property svn:eol-style set to native
File size: 600 bytes
Line 
1/*
2 * $Id$
3 *
4 * Code (c)2006 Bruno Cornec <bruno@mondorescue.org>
5 *
6 *     Main file of mr_err : a very small and simple
7 *     library for error management
8 *
9 * Provided under the GPLv2
10 */
11
12#ifndef _GNU_SOURCE
13#define _GNU_SOURCE
14#endif
15
16#include <stdio.h>
17#include <stdlib.h>
18
19#include "mr_msg.h"
20
21/* Pointer to the right cleanup function provided by each main */
22extern void *mr_cleanup(void);
23
24/*
25 * Function that frees memory if necessary
26 */
27void mr_exit(int errorcode, const char *message) {
28
29    mr_cleanup();
30    if (message != NULL) {
31        fprintf(stderr,"%s\n",message);
32    }
33    exit(errorcode);
34}
Note: See TracBrowser for help on using the repository browser.