--- libaitrpc/src/srv.c 2012/05/16 12:24:31 1.9.2.15 +++ libaitrpc/src/srv.c 2012/05/16 16:36:10 1.9.2.17 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: srv.c,v 1.9.2.15 2012/05/16 12:24:31 misho Exp $ +* $Id: srv.c,v 1.9.2.17 2012/05/16 16:36:10 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -82,6 +82,7 @@ txPacket(sched_task_t *task) if (rpc->call_argc) { f = rpc_srv_getCall(s, ntohs(rpc->call_tag)); if (!f) { + rpc_SetErr(EPROGUNAVAIL, "Function not found at RPC server"); rpc->call_argc ^= rpc->call_argc; rpc->call_rep.ret = RPC_ERROR(-1); rpc->call_rep.eno = RPC_ERROR(rpc_Errno); @@ -706,6 +707,14 @@ rpc_srv_initServer(u_int regProgID, u_char regProcID, else netBuf = io_align(netBuf, 1); /* align netBuf length */ +#ifdef HAVE_SRANDOMDEV + srandomdev(); +#else + time_t tim; + + srandom((time(&tim) ^ getpid())); +#endif + srv = malloc(sizeof(rpc_srv_t)); if (!srv) { LOGERR; @@ -791,10 +800,8 @@ rpc_srv_endServer(rpc_srv_t ** __restrict psrv) register int i; rpc_func_t *f, *tmp; - if (!psrv || !*psrv) { - rpc_SetErr(EINVAL, "Can`t destroy server because parameter is null!"); + if (!psrv || !*psrv) return; - } if (!(*psrv)->srv_blob.kill) rpc_srv_endBLOBServer(*psrv);