Changeset 6843a9c in mainline for uspace/srv/bd/file_bd/file_bd.c


Ignore:
Timestamp:
2012-06-29T13:02:14Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
722912e
Parents:
ba72f2b (diff), 0bbd13e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

Trivial conflicts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/file_bd/file_bd.c

    rba72f2b r6843a9c  
    119119        rc = loc_service_register(device_name, &service_id);
    120120        if (rc != EOK) {
    121                 printf(NAME ": Unable to register device '%s'.\n",
    122                         device_name);
     121                printf("%s: Unable to register device '%s'.\n",
     122                    NAME, device_name);
    123123                return rc;
    124124        }
    125 
    126         printf(NAME ": Accepting connections\n");
     125       
     126        printf("%s: Accepting connections\n", NAME);
    127127        task_retval(0);
    128128        async_manager();
    129 
     129       
    130130        /* Not reached */
    131131        return 0;
     
    139139static int file_bd_init(const char *fname)
    140140{
    141         int rc;
    142         long img_size;
    143 
    144         rc = loc_server_register(NAME, file_bd_connection);
    145         if (rc < 0) {
    146                 printf(NAME ": Unable to register driver.\n");
     141        async_set_client_connection(file_bd_connection);
     142        int rc = loc_server_register(NAME);
     143        if (rc != EOK) {
     144                printf("%s: Unable to register driver.\n", NAME);
    147145                return rc;
    148146        }
    149 
     147       
    150148        img = fopen(fname, "rb+");
    151149        if (img == NULL)
    152150                return EINVAL;
    153 
     151       
    154152        if (fseek(img, 0, SEEK_END) != 0) {
    155153                fclose(img);
    156154                return EIO;
    157155        }
    158 
    159         img_size = ftell(img);
     156       
     157        off64_t img_size = ftell(img);
    160158        if (img_size < 0) {
    161159                fclose(img);
    162160                return EIO;
    163161        }
    164 
     162       
    165163        num_blocks = img_size / block_size;
    166 
     164       
    167165        fibril_mutex_initialize(&dev_lock);
    168 
     166       
    169167        return EOK;
    170168}
     
    190188        }
    191189
    192         fs_va = as_get_mappable_page(comm_size);
    193         if (fs_va == NULL) {
     190        (void) async_share_out_finalize(callid, &fs_va);
     191        if (fs_va == AS_MAP_FAILED) {
    194192                async_answer_0(callid, EHANGUP);
    195193                return;
    196194        }
    197 
    198         (void) async_share_out_finalize(callid, fs_va);
    199195
    200196        while (true) {
Note: See TracChangeset for help on using the changeset viewer.