Changeset 1061 in MondoRescue for branches/stable/mondo/src


Ignore:
Timestamp:
Jan 18, 2007, 1:47:59 PM (17 years ago)
Author:
Bruno Cornec
Message:
  • 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
Location:
branches/stable/mondo/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-tools.c

    r1044 r1061  
    343343
    344344/**
    345  * Locate mondoarchive's home directory. Searches in /usr/local/mondo, /usr/share/mondo,
     345 * Locate mondoarchive's home directory. Searches in /usr/share/mondo,
    346346 * /usr/local/share/mondo, /opt, or if all else fails, search /usr.
    347347 *
  • branches/stable/mondo/src/include/mr_mem.h

    r1054 r1061  
    99#define MR_MEM_H
    1010
     11#ifndef _GNU_SOURCE
     12#define _GNU_SOURCE
     13#endif
     14#include <stdarg.h>
     15
    1116/* functions (public methods) */
    1217
    1318extern void mr_free(char *allocated);
    1419extern void mr_allocstr(char *alloc, const char *orig);
    15 extern void mr_asprintf(char **alloc, const char *fmt, ...);
    16 /*
    17 extern void mr_vasprintf(char **alloc, const char *fmt, va_list ap);
    18 */
     20extern void mr_asprintf(char **alloc, const char *fmt, va_list args);
    1921extern void mr_getline(char **lineptr, size_t *n, FILE *stream);
    2022extern void *mr_malloc(size_t size);
  • branches/stable/mondo/src/include/mr_msg.h

    r1054 r1061  
    99#define MR_MSG_H
    1010
     11#ifndef _GNU_SOURCE
     12#define _GNU_SOURCE
     13#endif
     14#include <stdarg.h>
     15
    1116/* functions (public methods) */
    1217
    13 #include <stdarg.h>
    14 
    15 extern void mr_msg(int debug, const char *fmt, ...);
     18extern void mr_msg(int debug, const char *fmt, va_list args);
    1619
    1720#endif                          /* MR_MSG_H */
  • branches/stable/mondo/src/lib/mr_err.c

    r1054 r1061  
    3636
    3737void mr_log_exit(int errorcode, const char *message) {
    38     mr_msg(0,message);
     38    mr_msg(0, message);
    3939    mr_exit(errorcode, message);
    4040}
  • branches/stable/mondo/src/lib/mr_mem.c

    r1054 r1061  
    1212#include <stdio.h>
    1313#include <stdlib.h>
    14 #include <stdarg.h>
    1514
    1615#include "mr_err.h"
     
    5352
    5453/* encapsulation function for asprintf */
    55 void mr_asprintf(char **strp, const char *fmt, ...) {
     54void mr_asprintf(char **strp, const char *fmt, va_list args) {
    5655
    57     va_list args;
    5856    int res = 0;
    5957
    60     va_start(args, fmt);
    6158    res = vasprintf(strp, fmt, args);
    6259    if (res == -1) {
    6360        mr_log_exit(-1,"Unable to alloc memory in mr_asprintf\nExiting...");
    6461    }
    65     va_end(args);
    6662}
    6763
  • branches/stable/mondo/src/lib/mr_msg.c

    r1054 r1061  
    3030    if ((fout = fopen(mr_logfile, "w")) == NULL) {
    3131        fprintf(stderr,"Unable to write to %s\n",mr_logfile);
    32         fprintf(stderr,"Logging desactivated\n",mr_logfile);
     32        fprintf(stderr,"Logging desactivated\n");
    3333        mr_msg_close();
    3434    }
     
    4141/*
    4242 * Function that log a message. Not called directly
    43  * but through macros in mr_msg.h
     43 * but through other functions
    4444 */
    45 void _mr_msg(int debug, const char *file, const char *function, int line, const char *fmt, ...) {
     45void _mr_msg(int debug, const char *file, const char *function, int line, const char *fmt, va_list args) {
    4646
    4747    int i = 0;
    4848    int res = 0;
    4949    FILE *fout = NULL;
    50     va_list args;
    5150
    5251    if (mr_logfile == NULL) {
     
    6665            fprintf(fout, "%s->%s#%d: ", file, function, line);
    6766        }
    68         va_start(args, fmt);
    6967        if (vfprintf(fout, fmt, args) < 0) {
    7068            fprintf(stderr,"Unable to print to %s\n",mr_logfile);
     69            return;
    7170        }
    72         va_end(args);
    7371
    7472        fprintf(fout, "\n");
     
    7977}
    8078
    81 void mr_msg(int level, const char *format, ...) {
     79void mr_msg(int level, const char *fmt, va_list args) {
    8280
    83     va_list args;
    84     va_start(args, format);
    85     _mr_msg(level, __FILE__, __FUNCTION__, __LINE__, format, args);
    86     va_end(args);
     81    _mr_msg(level, __FILE__, __FUNCTION__, __LINE__, fmt, args);
    8782}
Note: See TracChangeset for help on using the changeset viewer.