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

Last change on this file since 1256 was 1256, checked in by Bruno Cornec, 17 years ago

Begining of work on conf file introduction in mondo

  • create a new struct mr_ar_conf to store conf info
  • adds a static mr_ar_store_conf function to store conf file info in that struc
  • mondo.conf is now the .dist version
  • md5 not done yet

Not tested may not work at all nor compile

  • Property svn:eol-style set to native
File size: 892 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/* This should be a pointer to func setup by the main function */
22 /* Highly incomplete function for the moment */
23static void mr_cleanup(void) {
24 /* We have to free all allocated memory */
25 /* We have to remove all temporary files */
26 /* We have to unmount what has been mounted */
27 /* We have to properly end newt */
28 /* We have to remind people of log files */
29 mr_msg_close();
30}
31
32/*
33 * Function that frees memory if necessary
34 */
35void mr_exit(int errorcode, const char *message) {
36
37 mr_cleanup();
38 if (message != NULL) {
39 fprintf(stderr,"%s\n",message);
40 }
41 exit(errorcode);
42}
Note: See TracBrowser for help on using the repository browser.