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

Changeset 7171760 in mainline for uspace/app/bdsh/exec.c


Ignore:
Timestamp:
2011-08-18T12:05:00Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
b33ec43
Parents:
866e627
Message:

Rework the way how open files are passed from parent task to child.

  • Instead of passing fdi_node_t's, pass handles directly using the IPC_M_STATE_CHANGE_AUTHORIZE mechanism.
  • Remove open_node(), fd_node(), fdi_node_t.
  • Replace fopen_node() with fopen_handle().
  • Replace fnode() with fhandle().
  • The child task does not synchronize with VFS yet.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/exec.c

    r866e627 r7171760  
    100100        char *tmp;
    101101        int rc, retval, i;
    102         fdi_node_t file_nodes[3];
    103         fdi_node_t *file_nodes_p[4];
     102        int file_handles[3];
     103        int *file_handles_p[4];
    104104        FILE *files[3];
    105105
     
    112112       
    113113        for (i = 0; i < 3 && files[i] != NULL; i++) {
    114                 if (fnode(files[i], &file_nodes[i]) == EOK) {
    115                         file_nodes_p[i] = &file_nodes[i];
     114                if (fhandle(files[i], &file_handles[i]) == EOK) {
     115                        file_handles_p[i] = &file_handles[i];
    116116                }
    117117                else {
    118                         file_nodes_p[i] = NULL;
     118                        file_handles_p[i] = NULL;
    119119                }
    120120        }
    121         file_nodes_p[i] = NULL;
     121        file_handles_p[i] = NULL;
    122122
    123         rc = task_spawnvf(&tid, tmp, (const char **) argv, file_nodes_p);
     123        rc = task_spawnvf(&tid, tmp, (const char **) argv, file_handles_p);
    124124        free(tmp);
    125125
Note: See TracChangeset for help on using the changeset viewer.