Beispiel #1
0
int
ackReturnCode_(int s)
{
    struct LSFHeader repHdr;
    int rc;
    char hostname[MAXHOSTNAMELEN];
    static char fname[] = "ackReturnCode_";

    if (logclass & (LC_TRACE))
	ls_syslog(LOG_DEBUG, "%s: Entering this routine...", fname);

    gethostbysock_(s, hostname);
    currentSN = _getcurseqno_(hostname);
    rc = expectReturnCode_(s, currentSN, &repHdr);
    if (rc < 0)
        return rc;

    lsf_res_version = (int)repHdr.version;

    rc = resRC2LSErr_(repHdr.opCode);

    if (rc == 0)
        return 0;
    else
	return -1;

}
Beispiel #2
0
int
rgetRusageCompletionHandler_(struct lsRequest *request)
{
    XDR xdrs;
    int rc;

    rc = resRC2LSErr_(request->rc);
    if (rc != 0)
	return -1;
    xdrmem_create(&xdrs, request->replyBuf, request->replyBufLen, XDR_DECODE);
    if (! xdr_jRusage(&xdrs, (struct jRusage *)request->extra, NULL)) {
	lserrno = LSE_BAD_XDR;
	xdr_destroy(&xdrs);
	return -1;
    }

    xdr_destroy(&xdrs);
    return 0;

}
Beispiel #3
0
int 
rgetpidCompletionHandler_(struct lsRequest *request)
{
    struct resPid pidReply;
    XDR xdrs;
    int rc;

    
    rc = resRC2LSErr_(request->rc);
    if (rc != 0)
	return(-1);

    xdrmem_create(&xdrs, request->replyBuf, sizeof(struct resPid), XDR_DECODE);
    if (! xdr_resGetpid(&xdrs, &pidReply, NULL)) {
	lserrno = LSE_BAD_XDR;
	xdr_destroy(&xdrs);
	return(-1);
    }
    
    *((int *)request->extra) = pidReply.pid;
    xdr_destroy(&xdrs);
    return(0);

}