Changeset 1144 in MondoRescue for branches/stable/mondo/src/include
- Timestamp:
- Feb 12, 2007, 10:54:22 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/include/my-stuff.h
r1131 r1144 26 26 #include <stdio.h> 27 27 #include "mr_mem.h" 28 #include "mr_msg.h" 28 29 29 30 #if !defined(bool) && !defined(__cplusplus) … … 100 101 */ 101 102 #define MDSTAT_FILE "/proc/mdstat" 102 103 /**104 * @bug Apparently unused.105 */106 #define MONDO_TRACEFILE "/var/log/mondo-tracefile.log"107 103 108 104 #undef assert … … 245 241 * Log the file, line, Mondo error message, and OS error message (errno). 246 242 */ 247 #define log_OS_error(x) { log_msg(0, "%s, line %ld: %s (%s)", __FILE__, __LINE__, x, strerror(errno));}243 #define log_OS_error(x) {mr_msg(1, "%s, line %ld: %s (%s)", __FILE__, __LINE__, x, strerror(errno));} 248 244 249 245 /** … … 255 251 * close() @p x and log a message if it fails. 256 252 */ 257 #define paranoid_close(x) {if(close(x)) { log_msg(5, "close err");} x=-999; }253 #define paranoid_close(x) {if(close(x)) {mr_msg(5, "close err");} x=-999; } 258 254 259 255 /** 260 256 * fclose() @p x and log a message if it fails. 261 257 */ 262 #define paranoid_fclose(x) {if(fclose(x)) { log_msg(5, "fclose err");} x=NULL; }258 #define paranoid_fclose(x) {if(fclose(x)) {mr_msg(5, "fclose err");} x=NULL; } 263 259 264 260 /** 265 261 * pclose() @p x and log a message if it fails. 266 262 */ 267 #define paranoid_pclose(x) {if(pclose(x)) { log_msg(5, "pclose err");} x=NULL; }263 #define paranoid_pclose(x) {if(pclose(x)) {mr_msg(5, "pclose err");} x=NULL; } 268 264 269 265 /** 270 266 * Run the command @p x and log it if it fails. 271 267 */ 272 #define paranoid_system(x) {if(system(x)) log_msg(4, x); }268 #define paranoid_system(x) {if(system(x)) mr_msg(4, x); } 273 269 274 270 /** … … 354 350 355 351 /** 356 * Compatibility define to change log_it() calls to log_debug_msg() calls. 357 */ 358 #define log_it(format, args...) log_debug_msg(2, __FILE__, __FUNCTION__, __LINE__, format, ## args) 359 360 /** 361 * Macro to log a message along with file, line, and function information. 362 */ 363 #define log_msg(level, format, args...) log_debug_msg(level, __FILE__, __FUNCTION__, __LINE__, format, ## args) 352 * Shorter log command 353 */ 354 #define log_it(format, args...) mr_msg(2, format, ## args) 364 355 365 356 #define DEFAULT_DVD_DISK_SIZE 4380 ///< The default size (in MB) of a DVD disk, unless the user says otherwise.
Note:
See TracChangeset
for help on using the changeset viewer.