From: <kva...@ya...> - 2001-06-22 18:39:14
|
diff -Nru cluster-tools-0.5.0/cmd/clusternode_getstate.c cluster-tools-0.5.0-alpha/cmd/clusternode_getstate.c --- cluster-tools-0.5.0/cmd/clusternode_getstate.c Thu Jun 7 05:34:50 2001 +++ cluster-tools-0.5.0-alpha/cmd/clusternode_getstate.c Fri Jun 22 15:20:01 2001 @@ -16,6 +16,14 @@ * Questions/Comments/Bugfixes to ci-...@li... * */ +/* + * + * 22JUN2001 ane...@di... + * We need to check return values after calling function clusternode_info. + * Otherwise following 'printf' will dump + * + */ + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -71,8 +79,13 @@ exit(1); } - (void)clusternode_info(node, sizeof(ni), &ni); - printf("%s\n", states[ni.node_state]); + if(clusternode_info(node, sizeof(ni), &ni) >= 0) { + printf("%s\n", states[ni.node_state]); + } + else { + printf("Error in getting the cluster information \n"); + } + exit(0); } diff -Nru cluster-tools-0.5.0/libcluster/clusternode_info.c cluster-tools-0.5.0-alpha/libcluster/clusternode_info.c --- cluster-tools-0.5.0/libcluster/clusternode_info.c Thu Jun 7 05:34:50 2001 +++ cluster-tools-0.5.0-alpha/libcluster/clusternode_info.c Fri Jun 15 10:36:19 2001 @@ -35,6 +35,8 @@ iovec.tio_udatain = (caddr_t)&args; iovec.tio_udatainlen = sizeof(args); iovec.tio_udataout = (caddr_t)nodeinfo; +/* outlen is check inside kernel to be != 0 ane...@di... */ + iovec.tio_udataoutlen = sizeof(clusternode_info_t); return ssisys((char *)&iovec, sizeof(iovec)); } ____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie |