From ad03fc81563b5379ba4c175db10abfaf26d19bde Mon Sep 17 00:00:00 2001 From: Avi Date: Mon, 13 Mar 2023 11:04:46 +1000 Subject: [PATCH] Fix #382, Replace exit(1) and exit(-1) with EXIT_FAILURE macro --- fsw/mcp750-vxworks/src/cfe_psp_support.c | 2 +- fsw/pc-linux/src/cfe_psp_start.c | 2 +- fsw/pc-linux/src/cfe_psp_support.c | 2 +- fsw/pc-rtems/src/cfe_psp_support.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fsw/mcp750-vxworks/src/cfe_psp_support.c b/fsw/mcp750-vxworks/src/cfe_psp_support.c index b912c94c..abaebaa8 100644 --- a/fsw/mcp750-vxworks/src/cfe_psp_support.c +++ b/fsw/mcp750-vxworks/src/cfe_psp_support.c @@ -115,7 +115,7 @@ void CFE_PSP_Restart(uint32 reset_type) void CFE_PSP_Panic(int32 ErrorCode) { printf("CFE_PSP_Panic Called with error code = 0x%08X. Exiting.\n", (unsigned int)ErrorCode); - exit(-1); /* Need to improve this */ + exit(EXIT_FAILURE); /* Need to improve this */ } /****************************************************************************** diff --git a/fsw/pc-linux/src/cfe_psp_start.c b/fsw/pc-linux/src/cfe_psp_start.c index 71e83b48..e20fe995 100644 --- a/fsw/pc-linux/src/cfe_psp_start.c +++ b/fsw/pc-linux/src/cfe_psp_start.c @@ -531,7 +531,7 @@ void CFE_PSP_DisplayUsage(char *Name) printf(" %s --reset PO --subtype 1 --cpuid 1 --cpuname CPU1 --scid 32\n", Name); printf(" \n"); - exit(1); + exit(EXIT_SUCCESS); } /****************************************************************************** diff --git a/fsw/pc-linux/src/cfe_psp_support.c b/fsw/pc-linux/src/cfe_psp_support.c index 59e39da5..05602b29 100644 --- a/fsw/pc-linux/src/cfe_psp_support.c +++ b/fsw/pc-linux/src/cfe_psp_support.c @@ -130,7 +130,7 @@ void CFE_PSP_Panic(int32 ErrorCode) { OS_printf("CFE_PSP_Panic Called with error code = 0x%08X. Exiting.\n", (unsigned int)ErrorCode); OS_printf("The cFE could not start.\n"); - abort(); /* abort() is preferable to exit(-1), as it may create a core file for debug */ + abort(); /* abort() is preferable to exit(EXIT_FAILURE), as it may create a core file for debug */ } /****************************************************************************** diff --git a/fsw/pc-rtems/src/cfe_psp_support.c b/fsw/pc-rtems/src/cfe_psp_support.c index b72bc0d4..3cdc6166 100644 --- a/fsw/pc-rtems/src/cfe_psp_support.c +++ b/fsw/pc-rtems/src/cfe_psp_support.c @@ -81,7 +81,7 @@ void CFE_PSP_Restart(uint32 reset_type) { CFE_PSP_FlushCaches(1, PcRtems_ReservedMemBlock.BlockPtr, PcRtems_ReservedMemBlock.BlockSize); OS_printf("CFE_PSP_Restart is not implemented on this platform ( yet ! )\n"); - exit(-1); + exit(EXIT_FAILURE); } /******************************************************************************