From 143096999f3b69dc16b7ff118c1f49c96e7edb53 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Mon, 20 Apr 2026 23:39:42 +0200 Subject: [PATCH] Clean up opt tools, ftrustee and nwbind warning cases --- opt/CMakeLists.txt | 2 +- opt/unxsendm.c | 2 +- src/ftrustee.c | 2 +- src/nwbind.c | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/opt/CMakeLists.txt b/opt/CMakeLists.txt index 71ad281..a89fdbc 100644 --- a/opt/CMakeLists.txt +++ b/opt/CMakeLists.txt @@ -41,7 +41,7 @@ add_executable( comm comm.c ) add_executable( sendm sendm.c ) add_executable( unxcomm unxcomm.c ) add_executable( unxsendm unxsendm.c ) -# add_executable( xsockrt xsockrt.c ) +add_executable( xsockrt xsockrt.c ) ################################# # Linking diff --git a/opt/unxsendm.c b/opt/unxsendm.c index e884893..628be69 100644 --- a/opt/unxsendm.c +++ b/opt/unxsendm.c @@ -40,7 +40,7 @@ int main(int argc, char *argv[]) sprintf(path, "/usr/bin/sendmail %s", buf); f=popen(path, "w"); if (NULL != f) { - write(1, "+++++\n", 6); + if (write(1, "+++++\n", 6) < 0) {} while (0 < (size=bl_read(0, buf, sizeof(buf)))){ fwrite(buf, size, 1, f); } diff --git a/src/ftrustee.c b/src/ftrustee.c index 94406bf..2d74e8e 100644 --- a/src/ftrustee.c +++ b/src/ftrustee.c @@ -206,7 +206,7 @@ int do_export_trustees(char *expfn) j, v->sysname, v->unixname, fn); if (NULL != (f=fopen(fn, "w")) ) { chmod(fn, 0600); - chown(fn, 0, 0); + if (chown(fn, 0, 0)) {} fclose(f); diff --git a/src/nwbind.c b/src/nwbind.c index 482153f..298405b 100644 --- a/src/nwbind.c +++ b/src/nwbind.c @@ -67,19 +67,19 @@ static void write_to_nwserv(int what, int connection, int mode, 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)); + if (write(FD_NWSERV, &what, sizeof(int)) < 0) {} + if (write(FD_NWSERV, &connection, sizeof(int)) < 0) {} + if (write(FD_NWSERV, &mode, sizeof(int)) < 0) {} break; case 0x6666 : /* send to client that server holds message */ - write(FD_NWSERV, &what, sizeof(int)); - write(FD_NWSERV, &connection, sizeof(int)); + if (write(FD_NWSERV, &what, sizeof(int)) < 0) {} + if (write(FD_NWSERV, &connection, sizeof(int)) < 0) {} break; case 0xffff : /* tell nwserv to down the server */ - write(FD_NWSERV, &what, sizeof(int)); - write(FD_NWSERV, &what, sizeof(int)); + if (write(FD_NWSERV, &what, sizeof(int)) < 0) {} + if (write(FD_NWSERV, &what, sizeof(int)) < 0) {} break; default : break;