Changeset 258 for pjproject/trunk


Ignore:
Timestamp:
Mar 1, 2006 10:26:38 PM (19 years ago)
Author:
bennylp
Message:

Handle failure to open log file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/main.c

    r256 r258  
    847847 
    848848 
    849 void app_logging_init(void) 
     849pj_status_t app_logging_init(void) 
    850850{ 
    851851    /* Redirect log function to ours */ 
     
    855855    /* If output log file is desired, create the file: */ 
    856856 
    857     if (pjsua.log_filename) 
     857    if (pjsua.log_filename) { 
    858858        log_file = fopen(pjsua.log_filename, "wt"); 
     859        if (log_file == NULL) { 
     860            PJ_LOG(1,(THIS_FILE, "Unable to open log file %s",  
     861                      pjsua.log_filename));    
     862            return -1; 
     863        } 
     864    } 
     865 
     866    return PJ_SUCCESS; 
    859867} 
    860868 
     
    912920 
    913921    /* Init logging: */ 
    914     app_logging_init(); 
     922    if (app_logging_init() != PJ_SUCCESS) 
     923        return 1; 
    915924 
    916925 
Note: See TracChangeset for help on using the changeset viewer.