Changeset f9841e69 in mainline for kernel/generic/src/ipc/sysipc.c


Ignore:
Timestamp:
2012-09-02T21:52:11Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9ef1b79b
Parents:
fcfa926b
Message:

Call answer_preprocess() also when ipc_forward() returns error.

File:
1 edited

Legend:

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

    rfcfa926b rf9841e69  
    412412{
    413413        call_t *call = get_call(callid);
    414         bool need_old;
     414        phone_t *phone;
     415        bool need_old = answer_need_old(call);
     416        bool after_forward = false;
     417        ipc_data_t old;
    415418        int rc;
    416419
    417420        if (!call)
    418421                return ENOENT;
    419        
    420         phone_t *phone;
     422
     423        if (need_old)
     424                old = call->data;
     425       
    421426        if (phone_get(phoneid, &phone) != EOK) {
    422427                rc = ENOENT;
     
    465470        }
    466471       
    467         return ipc_forward(call, phone, &TASK->answerbox, mode);
     472        rc = ipc_forward(call, phone, &TASK->answerbox, mode);
     473        if (rc != EOK) {
     474                after_forward = true;
     475                goto error;
     476        }
     477
     478        return EOK;
    468479
    469480error:
    470         need_old = answer_need_old(call);
    471         ipc_data_t old;
    472 
    473         if (need_old)
    474                 old = call->data;
    475 
    476481        IPC_SET_RETVAL(call->data, EFORWARD);
    477482        answer_preprocess(call, need_old ? &old : NULL);
    478         ipc_answer(&TASK->answerbox, call);
     483        if (after_forward)
     484                _ipc_answer_free_call(call, false);
     485        else
     486                ipc_answer(&TASK->answerbox, call);
     487
    479488        return rc;
    480489}
Note: See TracChangeset for help on using the changeset viewer.