Mark functions not returning as sudo_noreturn

We also put NOTREACHED where it applies.
This commit is contained in:
Rose
2023-07-01 14:04:22 -04:00
parent 97e574091a
commit 45fdfa18f1
24 changed files with 47 additions and 35 deletions

View File

@@ -406,6 +406,7 @@ send_mail(const struct eventlog *evlog, const char *message)
strerror(errno));
sudo_debug_exit(__func__, __FILE__, __LINE__, sudo_debug_subsys);
_exit(EXIT_FAILURE);
/* NOTREACHED */
case 0:
/* Grandchild continues below. */
sudo_debug_enter(__func__, __FILE__, __LINE__, sudo_debug_subsys);
@@ -413,6 +414,7 @@ send_mail(const struct eventlog *evlog, const char *message)
default:
/* Parent will wait for us. */
_exit(EXIT_SUCCESS);
/* NOTREACHED */
}
break;
default:
@@ -472,7 +474,7 @@ send_mail(const struct eventlog *evlog, const char *message)
"unable to fork");
sudo_debug_exit(__func__, __FILE__, __LINE__, sudo_debug_subsys);
_exit(EXIT_FAILURE);
/* NOTREACHED */
/* NOTREACHED */
case 0:
/* Child. */
exec_mailer(pfd[0]);