Changeset 539 in MondoRescue for trunk/mondo/mondo/common/libmondo-tools.c


Ignore:
Timestamp:
May 13, 2006, 7:38:44 PM (18 years ago)
Author:
bcornec
Message:

merge -r 534:538 $SVN_M/branches/stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/common/libmondo-tools.c

    r507 r539  
    737737        strcpy(bkpinfo->isodir, "/");
    738738    } else {
    739         strcpy(bkpinfo->isodir, "/root/images/mondo");
     739        strcpy(bkpinfo->isodir, "/var/cache/mondo/iso");
    740740    }
    741741    strcpy(bkpinfo->prefix, STD_PREFIX);
     
    848848#endif
    849849
    850     if ((Lres = free_space_on_given_partition("/root")) == -1) {
     850    if ((Lres = free_space_on_given_partition("/var/cache/mondo")) == -1) /* {
    851851        Lres = free_space_on_given_partition("/");
    852852    }
     853    */
    853854    log_it("Free space on given partition = %ld MB", Lres);
    854855
    855856    if (Lres < 50) {
    856         run_program_and_log_output
    857             ("rm -Rf /root/images/mindi; mkdir -p /home/root/images/mindi; mkdir -p /root/images; ln -sf /home/root/images/mindi /root/images/mindi",
    858              3);
    859         //      fatal_error("Your / (or /root) partition has <50MB free. Please adjust your partition table to something saner.");
     857        fatal_error("Your /var/cache/mondo partition has <50MB free. Please adjust your partition table to something saner.");
    860858    }
    861859
     
    12161214}
    12171215
    1218 
    1219 /**
    1220  * The standard log_debug_msg() (log_msg() also due to a macro). Writes some describing
    1221  * information to the logfile.
    1222  */
    1223 void standard_log_debug_msg(int debug_level, const char *szFile,
    1224                             const char *szFunction, int nLine,
    1225                             const char *fmt, ...)
    1226 {
    1227     va_list args;
    1228     int i;
    1229     static int depth = 0;
    1230     FILE *fout;
    1231 
    1232     if (depth > 5) {
    1233         depth--;
    1234         return;
    1235     }
    1236     depth++;
    1237 
    1238     if (debug_level <= g_loglevel) {
    1239         va_start(args, fmt);
    1240         if (!(fout = fopen(MONDO_LOGFILE, "a"))) {
    1241             return;
    1242         }                       // fatal_error("Failed to openout to logfile - sheesh..."); }
    1243 
    1244         // add tabs to distinguish log levels
    1245         if (debug_level > 0) {
    1246             for (i = 1; i < debug_level; i++)
    1247                 fprintf(fout, "\t");
    1248             if (getpid() == g_main_pid)
    1249                 fprintf(fout, "[Main] %s->%s#%d: ", szFile, szFunction,
    1250                         nLine);
    1251             else if (getpid() == g_buffer_pid && g_buffer_pid > 0)
    1252                 fprintf(fout, "[Buff] %s->%s#%d: ", szFile, szFunction,
    1253                         nLine);
    1254             else
    1255                 fprintf(fout, "[TH=%d] %s->%s#%d: ", getpid(), szFile,
    1256                         szFunction, nLine);
    1257         }
    1258         vfprintf(fout, fmt, args);
    1259 
    1260         // do not slow down the progran if standard debug level
    1261         // must be enabled: if no flush, the log won't be up-to-date if there
    1262         // is a segfault
    1263         //if (g_dwDebugLevel != 1)
    1264 
    1265         va_end(args);
    1266         fprintf(fout, "\n");
    1267         paranoid_fclose(fout);
    1268     }
    1269     depth--;
    1270 }
    1271 
    1272 /**
    1273  * Function pointer to the @c log_debug_msg function to use. Points to standard_log_debug_msg() by default.
    1274  */
    1275 void (*log_debug_msg) (int, const char *, const char *, int, const char *,
    1276                        ...) = standard_log_debug_msg;
    1277 
    1278 
    12791216/**
    12801217 * Allocate or free important globals, depending on @p mal.
Note: See TracChangeset for help on using the changeset viewer.