/** * Get the destination for logging error reports. Env property OSPL_INFOFILE and * OSPL_LOGPATH controls this value. * If OSPL_INFOFILE is not set & this process is an OpenSplice service default * to logging to a file named ospl-info.log, otherwise * use standard out. * @see os_report_file_path */ char * os_reportGetInfoFileName() { char* file_name; char procIdentity[256]; static os_boolean doneOnce = OS_FALSE; os_reportInit(OS_FALSE); file_name = os_report_file_path ("ospl-info.log", (os_char *)os_env_infofile); /* @todo dds2881 - Uncomment below & remove above to enable application default error logging to stderr */ /* file_name = os_report_file_path (os_procIsOpenSpliceService() ? "ospl-info.log" : "<stdout>", os_env_infofile);*/ os_procFigureIdentity(procIdentity, sizeof (procIdentity)-1); procIdentity[sizeof (procIdentity)-1] = '\0'; if (!doneOnce) { doneOnce = OS_TRUE; if (!doAppend) { os_remove (file_name); } } return file_name; }
int app_remove(const char *path) { char realpath[MAX_PATH]; const char *fpath = handle_special_dirs(path, NEED_WRITE, realpath, sizeof (realpath)); if (!fpath) FILE_ERROR_RETURN(ENAMETOOLONG, -1); return os_remove(fpath); }
/** * Get the destination for logging error reports. Env property OSPL_ERRORFILE and * OSPL_LOGPATH controls this value. * If OSPL_ERRORFILE is not set & this process is an OpenSplice service default * to logging to a file named ospl-error.log, otherwise * use standard error. * @see os_report_file_path */ char * os_reportGetErrorFileName() { char* file_name; static os_boolean doneOnce = OS_FALSE; file_name = os_report_file_path ("ospl-error.log", (os_char *)os_env_errorfile); /* @todo dds2881 - Uncomment below & remove above to enable application default error logging to stderr */ /* file_name = os_report_file_path (os_procIsOpenSpliceService() ? "ospl-error.log" : "<stderr>", os_env_errorfile); */ if (!doneOnce) { doneOnce = OS_TRUE; if (!doAppend) { os_remove (file_name); } } return file_name; }