Avoid compiler casting warnings by assigning to the same type where possible

This saves instructions that are related to casting as well as compiler warnings.
This commit is contained in:
Rose
2023-05-18 14:38:18 -04:00
parent a0b074cc9c
commit e54ba33ea0
50 changed files with 175 additions and 168 deletions

View File

@@ -128,10 +128,10 @@ deliver_signal(struct monitor_closure *mc, int signo, bool from_parent)
* Send status to parent over socketpair.
* Return value is the same as send(2).
*/
static int
static ssize_t
send_status(int fd, struct command_status *cstat)
{
int n = -1;
ssize_t n = -1;
debug_decl(send_status, SUDO_DEBUG_EXEC);
if (cstat->type != CMD_INVALID) {
@@ -139,7 +139,7 @@ send_status(int fd, struct command_status *cstat)
"sending status message to parent: [%d, %d]",
cstat->type, cstat->val);
n = send(fd, cstat, sizeof(*cstat), 0);
if (n != sizeof(*cstat)) {
if (n != ssizeof(*cstat)) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_ERRNO,
"%s: unable to send status to parent", __func__);
}