Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 022d72ff in mainline


Ignore:
Timestamp:
2015-06-03T19:22:33Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
09024119
Parents:
eab9689
Message:

Improve code structure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ops/conctmeto.c

    reab9689 r022d72ff  
    7474static int answer_process(call_t *answer)
    7575{
    76         if (IPC_GET_RETVAL(answer->data) && ((int) answer->priv >= 0)) {
    77                 /*
    78                  * Something went wrong and there is a phone that needs to be
    79                  * deallocated.
    80                  */
    81                 phone_dealloc(answer->priv);
     76        int newphid = (int) answer->priv;
     77
     78        if (IPC_GET_RETVAL(answer->data)) {
     79                if (newphid >= 0) {
     80                        /*
     81                         * The phone was indeed allocated and now needs
     82                         * to be deallocated.
     83                         */
     84                        phone_dealloc(newphid);
     85                }
    8286        } else {
    83                 IPC_SET_ARG5(answer->data, answer->priv);
     87                IPC_SET_ARG5(answer->data, newphid);
    8488        }
    8589       
Note: See TracChangeset for help on using the changeset viewer.