* 79…199 │ (Currently unmapped)
* 200…241 │ systemd's private error codes (might be extended to 254 in future development)
* 242…254 │ (Currently unmapped, but see above)
- * 255 │ (We should probably stay away from that one, it's frequently used by applications to indicate an
- * │ exit reason that cannot really be expressed in a single exit status value — such as a propagated
- * │ signal or such)
+ *
+ * 255 │ EXIT_EXCEPTION (We use this to propagate exit-by-signal events. It's frequently used by others apps (like bash)
+ * │ to indicate exit reason that cannot really be expressed in a single exit status value — such as a propagated
+ * │ signal or such, and we follow that logic here.)
*/
switch (status) { /* We always cover the ISO C ones */
case EXIT_CONFIGURATION_DIRECTORY:
return "CONFIGURATION_DIRECTORY";
+
+ case EXIT_EXCEPTION:
+ return "EXCEPTION";
}
}
EXIT_CACHE_DIRECTORY,
EXIT_LOGS_DIRECTORY, /* 240 */
EXIT_CONFIGURATION_DIRECTORY,
+
+ EXIT_EXCEPTION = 255, /* Whenever we want to propagate an abnormal/signal exit, in line with bash */
};
typedef enum ExitStatusLevel {