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

Last change on this file since 1061 was 1061, checked in by Bruno Cornec, 17 years ago
  • mpt + ohci modules added for mindi
  • PATH fixed for init in restore (/usr/games added for petris + fixes)
  • Useless conf files removed from rootfs/etc or cleaned up
  • Still trying to have a working va_list by busybox alignment
  • Property svn:eol-style set to native
File size: 907 bytes
RevLine 
[1054]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#include <stdio.h>
13#include <stdlib.h>
14
15#include "mr_msg.h"
16
17/* This should be a pointer to func setup by the main function */
18 /* Highly incomplete function for the moment */
19static void mr_cleanup(void) {
20 /* We have to free all allocated memory */
21 /* We have to remove all temporary files */
22 /* We have to unmount what has been mounted */
23 /* We have to properly end newt */
24 /* We have to remind people of log files */
25}
26
27/*
28 * Function that frees memory if necessary
29 */
30void mr_exit(int errorcode, const char *message) {
31
32 mr_cleanup();
33 fprintf(stderr,"%s\n",message);
34 exit(errorcode);
35}
36
37void mr_log_exit(int errorcode, const char *message) {
[1061]38 mr_msg(0, message);
[1054]39 mr_exit(errorcode, message);
40}
Note: See TracBrowser for help on using the repository browser.