Changeset 95a3082 in mainline


Ignore:
Timestamp:
2012-09-01T22:07:14Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fcfa926b
Parents:
4cd7fd0
Message:

Call answer_preprocess() in call forwarding error paths.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/sysipc.c

    r4cd7fd0 r95a3082  
    412412{
    413413        call_t *call = get_call(callid);
     414        bool need_old;
     415        int rc;
     416
    414417        if (!call)
    415418                return ENOENT;
    416        
    417         call->flags |= IPC_CALL_FORWARDED;
    418419       
    419420        phone_t *phone;
    420421        if (phone_get(phoneid, &phone) != EOK) {
    421422                IPC_SET_RETVAL(call->data, EFORWARD);
    422                 ipc_answer(&TASK->answerbox, call);
    423                 return ENOENT;
     423                rc = ENOENT;
     424                goto error;
    424425        }
    425426       
    426427        if (!method_is_forwardable(IPC_GET_IMETHOD(call->data))) {
    427428                IPC_SET_RETVAL(call->data, EFORWARD);
    428                 ipc_answer(&TASK->answerbox, call);
    429                 return EPERM;
    430         }
     429                rc = EPERM;
     430                goto error;
     431        }
     432
     433        call->flags |= IPC_CALL_FORWARDED;
    431434       
    432435        /*
     
    465468       
    466469        return ipc_forward(call, phone, &TASK->answerbox, mode);
     470
     471error:
     472        need_old = answer_need_old(call);
     473        ipc_data_t old;
     474
     475        if (need_old)
     476                old = call->data;
     477
     478        answer_preprocess(call, need_old ? &old : NULL);
     479        ipc_answer(&TASK->answerbox, call);
     480        return rc;
    467481}
    468482
Note: See TracChangeset for help on using the changeset viewer.