Ignore:
Timestamp:
Jan 28, 2007, 7:04:41 PM (13 years ago)
Author:
bruno
Message:
  • Fix mindi install messages (reported by Andree Leidenfrost)
  • remove paranoid_free/free for mr_free
  • mr_asprintf used everywhere
  • mr_malloc used everywhere
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/mondorestore/mondo-rstr-newt.c

    r738 r1080  
    11/***************************************************************************
    2 mondo-rstr-newt.c  -  description
    3 -----------------
    4 
    5 begin: Fri Apr 19 16:40:35 EDT 2002
    6 copyright : (C) 2002 Mondo  Hugo Rabson
    7 email     : Hugo Rabson <hugorabson@msn.com>
    8 edited by : by Stan Benoit 4/2002
    9 email     : troff@nakedsoul.org
    10 cvsid     : $Id$
    11 ***************************************************************************/
    12 
    13 /***************************************************************************
    14  *                                                                         *
    15  *   This program is free software; you can redistribute it and/or modify  *
    16  *   it under the terms of the GNU General Public License as published by  *
    17  *   the Free Software Foundation; either version 2 of the License, or     *
    18  *   (at your option) any later version.                                   *
    19  *                                                                         *
    20  ***************************************************************************/
    21 /* mondo-rstr-newt.c               Hugo Rabson
    22 
    23 
    24 07/12
    25 - wider mountlist entry editor window
    26 
    27 03/28/2004
    28 - removed g_mountlist_fname
    29 
    30 07/02/2003
    31 - fixed calls to popup_and_get_string()
    32 
    33 06/05
    34 - cleaned up get_isodir_info()
    35 
    36 05/02
    37 - added strip_path() to improve file list display for long paths (Conor)
    38 
    39 04/24
    40 - added lots of assert()'s and log_OS_error()'s
    41 
    42 04/08/2003
    43 - commented out call to sort_mountlist_by_device(), just in case it's
    44   futzing with LVM/RAID users
    45 
    46 08/21/2002
    47 - fix MOUNTLIST_FNAME and RAIDTAB_FNAME if Reload button finds them empty
    48 
    49 08/19
    50 - fixed what_number_cd_is_this() to take bkpinfo as parameter
    51 
    52 07/01 - 07/31
    53 - renamed from mondo-newt.c to mondo-rstr-newt.c
    54 - moved lots of subroutines to libmondo-newt.c
    55 - added hooks to libmondo
    56 - better handling of yes/no/YES/NO
    57 - better "% done" feedback (Philippe de Muyter)
    58 
    59 05/01 - 06/30
    60 - trim trailing \n from fgets() in a couple of functions
    61 - expanded "May I write mountlist?" message
    62 - replace scanf() with a properly restricted fgets() (Troff)
    63 
    64 02/01 - 02/28/2002
    65 - allow up to 50 chars in popup_and_get_string()'s input field
    66 - if g_current_progress > g_maximum_progress then g_current_progress=g_max...
    67   to stop the progress bar from shooting off the RHS of the screen :)
    68 - beefed up the RAID-related logging a bit
    69 - don't complain if partition format is a number (1-255)
    70 - if hard disk does not exist then warn user when editing mountlist
    71 - when running 'eject -t', log its output
    72 
    73 [...]
    74 
    75 08/09/2001
    76 - created
     2 * $Id$
    773*/
     4
     5#include "mr_mem.h"
    786
    797
     
    16501578    malloc_string(sz_parity_disks);
    16511579    malloc_string(sz_failed_disks);
    1652     if (!(bkp_raidrec = malloc(sizeof(struct raid_device_record)))) {
    1653         fatal_error("Cannot malloc space for raidrec");
    1654     }
     1580    bkp_raidrec = mr_malloc(sizeof(struct raid_device_record));
    16551581
    16561582    log_it("Started edit_raidlist_entry");
     
    17271653        calculate_raid_device_size(mountlist, raidlist,
    17281654                                   raidrec->raid_device);
    1729     paranoid_free(title_of_editraidForm_window);
    1730     paranoid_free(sz_raid_level);
    1731     paranoid_free(sz_data_disks);
    1732     paranoid_free(sz_spare_disks);
    1733     paranoid_free(sz_parity_disks);
    1734     paranoid_free(sz_failed_disks);
    1735     paranoid_free(bkp_raidrec);
     1655    mr_free(title_of_editraidForm_window);
     1656    mr_free(sz_raid_level);
     1657    mr_free(sz_data_disks);
     1658    mr_free(sz_spare_disks);
     1659    mr_free(sz_parity_disks);
     1660    mr_free(sz_failed_disks);
     1661    mr_free(bkp_raidrec);
    17361662#endif
    17371663}
     
    17811707    struct mountlist_itself *unallocparts;
    17821708
    1783     unallocparts = malloc(sizeof(struct mountlist_itself));
     1709    unallocparts = mr_malloc(sizeof(struct mountlist_itself));
    17841710
    17851711    log_it("Started edit_raidlist_entry");
     
    28162742    malloc_string(sz_res);
    28172743    malloc_string(header_text);
    2818     if (!(bkp_raidrec = malloc(sizeof(struct raid_device_record)))) {
    2819         fatal_error("Cannot malloc space for raidrec");
    2820     }
    2821     if (!(bkp_disklist = malloc(sizeof(struct list_of_disks)))) {
    2822         fatal_error("Cannot malloc space for disklist");
    2823     }
    2824     if (!(bkp_raidlist = malloc(sizeof(struct raidlist_itself)))) {
    2825         fatal_error("Cannot malloc space for raidlist");
    2826     }
    2827     if (!
    2828         (unallocated_raid_partitions =
    2829          malloc(sizeof(struct mountlist_itself)))) {
    2830         fatal_error("Cannot malloc space for unallocated_raid_partitions");
    2831     }
     2744    bkp_raidrec = mr_malloc(sizeof(struct raid_device_record));
     2745    bkp_disklist = mr_malloc(sizeof(struct list_of_disks));
     2746    bkp_raidlist = mr_malloc(sizeof(struct raidlist_itself));
     2747    unallocated_raid_partitions = mr_malloc(sizeof(struct mountlist_itself));
    28322748
    28332749    memcpy((void *) bkp_raidlist, (void *) raidlist,
     
    29202836               sizeof(struct list_of_disks));
    29212837    }
    2922     paranoid_free(tmp);
    2923     paranoid_free(help_text);
    2924     paranoid_free(title_of_window);
    2925     paranoid_free(sz_res);
    2926     paranoid_free(header_text);
    2927     paranoid_free(bkp_raidrec);
    2928     paranoid_free(bkp_disklist);
    2929     paranoid_free(bkp_raidlist);
    2930     paranoid_free(unallocated_raid_partitions);
     2838    mr_free(tmp);
     2839    mr_free(help_text);
     2840    mr_free(title_of_window);
     2841    mr_free(sz_res);
     2842    mr_free(header_text);
     2843    mr_free(bkp_raidrec);
     2844    mr_free(bkp_disklist);
     2845    mr_free(bkp_raidlist);
     2846    mr_free(unallocated_raid_partitions);
    29312847}
    29322848#endif
Note: See TracChangeset for help on using the changeset viewer.