Fix ncpserv, nwfile and nwshare warning hot spots

This commit is contained in:
Mario Fetka
2026-04-20 23:39:42 +02:00
parent 9087018b59
commit 8e8b837c63
3 changed files with 40 additions and 38 deletions

View File

@@ -84,29 +84,29 @@ static void write_to_nwserv(int what, int connection, int mode,
{
switch (what) {
case 0x2222 : /* insert wdog connection */
write(FD_NWSERV, &what, sizeof(int));
write(FD_NWSERV, &connection, sizeof(int));
write(FD_NWSERV, &size, sizeof(int));
write(FD_NWSERV, data, size); /* ipxAddr_t + socknr */
(void)write(FD_NWSERV, &what, sizeof(int));
(void)write(FD_NWSERV, &connection, sizeof(int));
(void)write(FD_NWSERV, &size, sizeof(int));
(void)write(FD_NWSERV, data, size); /* ipxAddr_t + socknr */
break;
case 0x4444 : /* tell the wdog there's no need to look 0 */
/* activate wdogs to free connection 1 */
/* the connection ist closed 99 */
write(FD_NWSERV, &what, sizeof(int));
write(FD_NWSERV, &connection, sizeof(int));
write(FD_NWSERV, &mode, sizeof(int));
(void)write(FD_NWSERV, &what, sizeof(int));
(void)write(FD_NWSERV, &connection, sizeof(int));
(void)write(FD_NWSERV, &mode, sizeof(int));
break;
case 0x5555 : /* close connection */
case 0x6666 : /* send to client that server holds message */
write(FD_NWSERV, &what, sizeof(int));
write(FD_NWSERV, &connection, sizeof(int));
(void)write(FD_NWSERV, &what, sizeof(int));
(void)write(FD_NWSERV, &connection, sizeof(int));
break;
case 0xffff : /* tell nwserv to down the server */
write(FD_NWSERV, &what, sizeof(int));
write(FD_NWSERV, &what, sizeof(int));
(void)write(FD_NWSERV, &what, sizeof(int));
(void)write(FD_NWSERV, &what, sizeof(int));
break;
default : break;
@@ -739,7 +739,7 @@ int main(int argc, char *argv[])
return(1);
}
nwconn_state = shmat(nwconn_state_shm_id, NULL, SHM_R);
if ((int )(nwconn_state) == -1) {
if (nwconn_state == (char *)-1) {
errorp(1, "Can't attach shared memory segment", NULL);
return(1);
}