Make sure signals aren't blocked while autoloading, also add a few consistency checks to see that signals aren't blocked in critical places

darcs-hash:20061029210911-ac50b-50bec85c3d59d0332ba44f3ece1a012cdc3e8c4b.gz
This commit is contained in:
axel
2006-10-30 07:09:11 +10:00
parent a6c00ca0d2
commit f83575f084
8 changed files with 79 additions and 29 deletions

View File

@@ -74,7 +74,7 @@ extern wchar_t *program_name;
failiure, the current function is ended at once. The second
parameter is the exit status of the current function on failiure.
*/
#define CHECK( arg, retval ) \
#define CHECK( arg, retval ) \
if( !(arg) ) \
{ \
debug( 1, \
@@ -85,18 +85,44 @@ extern wchar_t *program_name;
#arg, \
PACKAGE_BUGREPORT ); \
return retval; \
} \
}
/**
Exit program at once, leaving an error message about running out of memory
*/
#define DIE_MEM() \
#define DIE_MEM() \
{ \
fwprintf( stderr, L"fish: Out of memory on line %d of file %s, shutting down fish\n", __LINE__, __FILE__ ); \
fwprintf( stderr, \
L"fish: Out of memory on line %d of file %s, shutting down fish\n", \
__LINE__, \
__FILE__ ); \
exit(1); \
} \
}
/**
Cause fish to crash. This should only be usd for debugging.
*/
#define CRASH() \
{ \
int *n = 0; \
*n = 1; \
}
/**
Check if signals are blocked
*/
#define CHECK_BLOCK( retval ) \
if( signal_is_blocked() ) \
{ \
debug( 0, \
L"function %s called while blocking signals. " \
L"This is a bug. " \
L"If you can reproduce it, please send a bug report to %s.", \
__func__, \
PACKAGE_BUGREPORT ); \
return retval; \
}
/**
Shorthand for wgettext call
*/