The big NULL replacement party part 6.

...and ', NULL' had even more to replace.
This commit is contained in:
Jason Felds
2013-05-03 23:49:23 -04:00
parent 28e5148dec
commit 07b9fb6da5
95 changed files with 2582 additions and 2582 deletions
+19 -19
View File
@@ -80,13 +80,13 @@ static void NORETURN spawn_child_process( int from_parent )
strncpy( magic, CHILD_MAGIC_PARAMETER, sizeof(magic) );
/* Use execve; it's the lowest-level of the exec calls. The others may allocate. */
char *argv[3] = { path, magic, NULL };
char *argv[3] = { path, magic, nullptr };
char *envp[1] = { NULL };
execve( path, argv, envp );
/* If we got here, the exec failed. We can't call strerror. */
// safe_print(fileno(stderr), "Crash handler execl(", path, ") failed: ", strerror(errno), "\n", NULL);
safe_print( fileno(stderr), "Crash handler execl(", path, ") failed: ", itoa( errno ), "\n", NULL );
// safe_print(fileno(stderr), "Crash handler execl(", path, ") failed: ", strerror(errno), "\n", nullptr);
safe_print( fileno(stderr), "Crash handler execl(", path, ") failed: ", itoa( errno ), "\n", nullptr );
_exit(1);
}
@@ -108,13 +108,13 @@ static bool parent_write( int to_child, const void *p, size_t size )
int ret = retried_write( to_child, p, size );
if( ret == -1 )
{
safe_print( fileno(stderr), "Unexpected write() result (", strerror(errno), ")\n", NULL );
safe_print( fileno(stderr), "Unexpected write() result (", strerror(errno), ")\n", nullptr );
return false;
}
if( size_t(ret) != size )
{
safe_print( fileno(stderr), "Unexpected write() result (", itoa(ret), ")\n", NULL );
safe_print( fileno(stderr), "Unexpected write() result (", itoa(ret), ")\n", nullptr );
return false;
}
@@ -205,7 +205,7 @@ static void RunCrashHandler( const CrashData *crash )
{
if( g_pCrashHandlerArgv0 == nullptr )
{
safe_print( fileno(stderr), "Crash handler failed: CrashHandlerHandleArgs was not called\n", NULL );
safe_print( fileno(stderr), "Crash handler failed: CrashHandlerHandleArgs was not called\n", nullptr );
_exit( 1 );
}
@@ -213,9 +213,9 @@ static void RunCrashHandler( const CrashData *crash )
struct sigaction sa;
memset( &sa, 0, sizeof(sa) );
sa.sa_handler = SIG_IGN;
if( sigaction( SIGPIPE, &sa, NULL ) != 0 )
if( sigaction( SIGPIPE, &sa, nullptr ) != 0 )
{
safe_print( fileno(stderr), "sigaction() failed: %s", strerror(errno), NULL );
safe_print( fileno(stderr), "sigaction() failed: %s", strerror(errno), nullptr );
/* non-fatal */
}
@@ -229,22 +229,22 @@ static void RunCrashHandler( const CrashData *crash )
switch( crash->type )
{
case CrashData::SIGNAL:
safe_print( fileno(stderr), "Fatal signal (", SignalName(crash->signal), ")", NULL );
safe_print( fileno(stderr), "Fatal signal (", SignalName(crash->signal), ")", nullptr );
break;
case CrashData::FORCE_CRASH:
safe_print( fileno(stderr), "Crash handler failed: \"", crash->reason, "\"", NULL );
safe_print( fileno(stderr), "Crash handler failed: \"", crash->reason, "\"", nullptr );
break;
default:
safe_print( fileno(stderr), "Unexpected RunCrashHandler call (", itoa(crash->type), ")", NULL );
safe_print( fileno(stderr), "Unexpected RunCrashHandler call (", itoa(crash->type), ")", nullptr );
break;
}
if( active == 1 )
safe_print( fileno(stderr), " while still in the crash handler\n", NULL);
safe_print( fileno(stderr), " while still in the crash handler\n", nullptr);
else if( active == 2 )
safe_print( fileno(stderr), " while in the crash handler child\n", NULL);
safe_print( fileno(stderr), " while in the crash handler child\n", nullptr);
_exit( 1 );
}
@@ -259,14 +259,14 @@ static void RunCrashHandler( const CrashData *crash )
int fds[2];
if( pipe(fds) != 0 )
{
safe_print( fileno(stderr), "Crash handler pipe() failed: ", strerror(errno), "\n", NULL );
safe_print( fileno(stderr), "Crash handler pipe() failed: ", strerror(errno), "\n", nullptr );
exit( 1 );
}
pid_t childpid = fork();
if( childpid == -1 )
{
safe_print( fileno(stderr), "Crash handler fork() failed: ", strerror(errno), "\n", NULL );
safe_print( fileno(stderr), "Crash handler fork() failed: ", strerror(errno), "\n", nullptr );
_exit( 1 );
}
@@ -297,7 +297,7 @@ static void RunCrashHandler( const CrashData *crash )
RageThread::ResumeAllThreads();
if( WIFSIGNALED(status) )
safe_print( fileno(stderr), "Crash handler child exited with signal ", itoa(WTERMSIG(status)), "\n", NULL );
safe_print( fileno(stderr), "Crash handler child exited with signal ", itoa(WTERMSIG(status)), "\n", nullptr );
}
}
@@ -332,7 +332,7 @@ void CrashHandler::ForceCrash( const char *reason )
strncpy( crash.reason, reason, sizeof(crash.reason) );
crash.reason[ sizeof(crash.reason)-1 ] = 0;
GetBacktrace( crash.BacktracePointers[0], BACKTRACE_MAX_SIZE, NULL );
GetBacktrace( crash.BacktracePointers[0], BACKTRACE_MAX_SIZE, nullptr );
RunCrashHandler( &crash );
}
@@ -344,7 +344,7 @@ void CrashHandler::ForceDeadlock( RString reason, uint64_t iID )
crash.type = CrashData::FORCE_CRASH;
GetBacktrace( crash.BacktracePointers[0], BACKTRACE_MAX_SIZE, NULL );
GetBacktrace( crash.BacktracePointers[0], BACKTRACE_MAX_SIZE, nullptr );
if( iID == GetInvalidThreadId() )
{
@@ -376,7 +376,7 @@ void CrashHandler::CrashSignalHandler( int signal, siginfo_t *si, const ucontext
static volatile bool bInCrashSignalHandler = false;
if( bInCrashSignalHandler )
{
safe_print( 2, "Fatal: crash from within the crash signal handler\n", NULL );
safe_print( 2, "Fatal: crash from within the crash signal handler\n", nullptr );
_exit(1);
}