Changeset 3509 in MondoRescue for branches/3.2/mondo/src/lib/mr_file.c


Ignore:
Timestamp:
Feb 13, 2016, 2:57:55 AM (8 years ago)
Author:
Bruno Cornec
Message:
  • Change mr_msg_int interface by adding the FUNCTION macro
  • Use mr_msg in mr_system
  • Ability to use that new log system everywhere now
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/lib/mr_file.c

    r1136 r3509  
    2323
    2424    if ((fd = fopen(path, mode)) == NULL) {
    25         mr_msg_int(1,line,file,"Unable to open %s",path);
     25        mr_msg_int(1,line,file,"mr_fopen_int","Unable to open %s",path);
    2626        mr_exit(-1,"Exiting");
    2727    }
     
    3434
    3535    if (fd == NULL) {
    36         mr_msg_int(1,line,file,"fd is NULL.\nShould NOT happen.");
     36        mr_msg_int(1,line,file,"mr_fprintf_int","fd is NULL.\nShould NOT happen.");
    3737        mr_exit(-1,"Exiting");
    3838    }
    3939    va_start(args,fmt);
    4040    if (vfprintf(fd, fmt, args) < 0) {
    41         mr_msg_int(1,line,file,"Unable to print to fd");
     41        mr_msg_int(1,line,file,"mr_fprintf_int","Unable to print to fd");
    4242        mr_exit(-1,"Exiting");
    4343    }
     
    4848
    4949    if (fd == NULL) {
    50         mr_msg_int(1,line,file,"fd is NULL.\nShould NOT happen.");
     50        mr_msg_int(1,line,file,"mr_fclose_int","fd is NULL.\nShould NOT happen.");
    5151        mr_exit(-1,"Exiting");
    5252    }
    5353    if (*fd == NULL) {
    54         mr_msg_int(1,line,file,"File descriptor is NULL.\nShould NOT happen.");
     54        mr_msg_int(1,line,file,"mr_fclose_int","File descriptor is NULL.\nShould NOT happen.");
    5555        mr_exit(-1,"Exiting");
    5656    }
    5757    if (fclose(*fd) < 0) {
    58         mr_msg_int(1,line,file,"Unable to close File Descriptor");
     58        mr_msg_int(1,line,file,"mr_fclose_int","Unable to close File Descriptor");
    5959    }
    6060    *fd = NULL;
     
    6464
    6565    if (mkdir(pathname,mode) != 0) {
    66         mr_msg_int(1,line,file,"Unable to create directory %s",pathname);
     66        mr_msg_int(1,line,file,"mr_mkdir_int","Unable to create directory %s",pathname);
    6767        mr_exit(-1,"Exiting");
    6868    }
Note: See TracChangeset for help on using the changeset viewer.