Updated exit codes as constant values
Re-allocated exit status codes according to three references, which follow:
BSD sysexits.h:http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
GNU recomendations:http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
Bash scripting:http://tldp.org/LDP/abs/html/exitcodes.html
The GNU recommendations stem from and expand upon the standard C/C++ library (stdlibc)
definitions, while also suggesting some best-practice conventions which happen to prevent
exit status code collisions with bash, and probably other shells.
The re-allocated codes are now mapped to constant values, set in *application/config/constants.php*,
and used throughout the CodeIgniter core. They would additionally be used in *index.php*,
but the constants file hasn't been loaded at that point, so the integer values are used
instead, and a comment follows each such use with amplifying information on why that
particular value was selected.
Finally, the errors documentation has been updated accordingly.
Signed-off-by: Daniel Hunsaker <danhunsaker@gmail.com>
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php
index daf59f5..25863ea 100644
--- a/system/helpers/download_helper.php
+++ b/system/helpers/download_helper.php
@@ -142,7 +142,7 @@
if ($data !== NULL)
{
echo $data;
- exit(0);
+ exit(EXIT_SUCCESS);
}
// Flush 1MB chunks of data
@@ -152,7 +152,7 @@
}
fclose($fp);
- exit(0);
+ exit(EXIT_SUCCESS);
}
}
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index d6bf7e2..7d5ccff 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -550,7 +550,7 @@
header('Location: '.$uri, TRUE, $code);
break;
}
- exit(0);
+ exit(EXIT_SUCCESS);
}
}