Changeset 3898 in MondoRescue for branches/3.3/mondo/src


Ignore:
Timestamp:
Dec 7, 2024, 3:21:00 AM (8 months ago)
Author:
Bruno Cornec
Message:

create alloc_bkpinfo function and fix reset_bkpinfo proto

Location:
branches/3.3/mondo/src/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mondo/src/common/libmondo-tools-EXT.h

    r3879 r3898  
    66extern int read_cfg_var(char *config_file, char *label, char *value);
    77extern int write_cfg_var(char *config_file, char *label, char *value);
    8 extern void reset_bkpinfo();
     8extern void alloc_bkpinfo(void);
     9extern void reset_bkpinfo(void);
    910#ifdef __FreeBSD__
    1011extern void initialize_raidrec(struct vinum_volume *vv);
  • branches/3.3/mondo/src/common/libmondo-tools.c

    r3892 r3898  
    893893}
    894894
    895 
    896895/**
    897896 * Reset all fields of the backup information structure to a sensible default.
    898897 * @param bkpinfo The @c bkpinfo to reset.
    899898 */
    900 void reset_bkpinfo()
    901 {
     899void alloc_bkpinfo(void) {
     900
     901if (! (bkpinfo = (struct s_bkpinfo *)malloc(sizeof(struct s_bkpinfo)))) {
     902        fatal_error("Cannot malloc bkpinfo");
     903    }
     904}
     905
     906/**
     907 * Reset all fields of the backup information structure to a sensible default.
     908 * @param bkpinfo The @c bkpinfo to reset.
     909 */
     910void reset_bkpinfo(void) {
     911
    902912    assert(bkpinfo != NULL);
    903913    memset((void *) bkpinfo, 0, sizeof(struct s_bkpinfo));
Note: See TracChangeset for help on using the changeset viewer.