Changeset ce04ea44 in mainline for uspace/app/bdsh/cmds


Ignore:
Timestamp:
2017-04-02T12:27:14Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d4067a7
Parents:
163fc09
Message:

Rename read() to vfs_read() and write() to vfs_write()

Location:
uspace/app/bdsh/cmds/modules
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    r163fc09 rce04ea44  
    251251                }
    252252               
    253                 bytes = read(fd, &pos, buff + copied_bytes, bytes_to_read);
     253                bytes = vfs_read(fd, &pos, buff + copied_bytes, bytes_to_read);
    254254                copied_bytes = 0;
    255255
  • uspace/app/bdsh/cmds/modules/cmp/cmp.c

    r163fc09 rce04ea44  
    9494                        ssize_t size;
    9595                        do {
    96                                 size = read(fd[i], &pos[i],
     96                                size = vfs_read(fd[i], &pos[i],
    9797                                    buffer[i] + offset[i],
    9898                                    CMP_BUFLEN - offset[i]);
    9999                                if (size < 0) {
    100                                         rc = errno;
     100                                        rc = size;
    101101                                        printf("Error reading from %s\n",
    102102                                            fn[i]);
  • uspace/app/bdsh/cmds/modules/cp/cp.c

    r163fc09 rce04ea44  
    413413        }
    414414
    415         while ((bytes = read(fd1, &posr, buff, blen)) > 0) {
    416                 if ((bytes = write(fd2, &posw, buff, bytes)) < 0)
     415        while ((bytes = vfs_read(fd1, &posr, buff, blen)) > 0) {
     416                if ((bytes = vfs_write(fd2, &posw, buff, bytes)) < 0)
    417417                        break;
    418418                copied += bytes;
     
    420420
    421421        if (bytes < 0) {
    422                 printf("\nError copying %s, (%d)\n", src, errno);
     422                printf("\nError copying %s, (%d)\n", src, bytes);
    423423                copied = bytes;
    424424        }
  • uspace/app/bdsh/cmds/modules/mkfile/mkfile.c

    r163fc09 rce04ea44  
    166166               
    167167                pos = file_size - 1;
    168                 rc2 = write(fd, &pos, &byte, sizeof(char));
     168                rc2 = vfs_write(fd, &pos, &byte, sizeof(char));
    169169                if (rc2 < 0) {
    170170                        vfs_put(fd);
     
    183183        while (total_written < file_size) {
    184184                to_write = min(file_size - total_written, BUFFER_SIZE);
    185                 rc = write(fd, &pos, buffer, to_write);
     185                rc = vfs_write(fd, &pos, buffer, to_write);
    186186                if (rc <= 0) {
    187187                        printf("%s: Error writing file (%d).\n", cmdname, errno);
Note: See TracChangeset for help on using the changeset viewer.