Changeset d5c1051 in mainline for uspace/app/bdsh


Ignore:
Timestamp:
2017-12-20T22:25:34Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
39b54fe
Parents:
8610c2c
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-20 22:22:29)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-20 22:25:34)
Message:

"Obviously harmless" error handling tweaks.

Location:
uspace/app/bdsh
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/builtins/batch/batch.c

    r8610c2c rd5c1051  
    8585        }
    8686
    87         int rc = 0;
     87        int rc = EOK;
    8888        FILE *batch = fopen(argv[1], "r");
    8989        if (batch == NULL) {
     
    104104                                if (cur == fusr.line) {
    105105                                        /* skip empty line */
    106                                         rc = 0;
     106                                        rc = EOK;
    107107                                        free(cur);
    108108                                } else {
  • uspace/app/bdsh/cmds/builtins/cd/cd.c

    r8610c2c rd5c1051  
    8585int cmd_cd(char **argv, cliuser_t *usr)
    8686{
    87         int argc, rc = 0;
     87        int argc;
     88        int rc = EOK;
    8889
    8990        argc = cli_count_args(argv);
  • uspace/app/bdsh/cmds/modules/mkdir/mkdir.c

    r8610c2c rd5c1051  
    9494
    9595        int ret = 0;
     96        int rc;
    9697
    9798        if (!create_parents) {
    98                 ret = vfs_link_path(path, KIND_DIRECTORY, NULL);
    99                 if (ret != EOK) {
     99                rc = vfs_link_path(path, KIND_DIRECTORY, NULL);
     100                if (rc != EOK) {
    100101                        cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    101                             cmdname, path, str_error(ret));
     102                            cmdname, path, str_error(rc));
    102103                        ret = 1;
    103104                }
     
    135136                        path[prev_off] = 0;
    136137
    137                         ret = vfs_link_path(path, KIND_DIRECTORY, NULL);
    138                         if (ret != EOK && ret != EEXIST) {
     138                        rc = vfs_link_path(path, KIND_DIRECTORY, NULL);
     139                        if (rc != EOK && rc != EEXIST) {
    139140                                cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    140                                     cmdname, path, str_error(ret));
     141                                    cmdname, path, str_error(rc));
    141142                                ret = 1;
    142143                                goto leave;
     
    146147                }
    147148                /* Create the final directory. */
    148                 ret = vfs_link_path(path, KIND_DIRECTORY, NULL);
    149                 if (ret != EOK) {
     149                rc = vfs_link_path(path, KIND_DIRECTORY, NULL);
     150                if (rc != EOK) {
    150151                        cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    151                             cmdname, path, str_error(ret));
     152                            cmdname, path, str_error(rc));
    152153                        ret = 1;
    153154                }
  • uspace/app/bdsh/cmds/modules/mkfile/mkfile.c

    r8610c2c rd5c1051  
    202202        free(buffer);
    203203
    204         if (vfs_put(fd) < 0)
     204        if (vfs_put(fd) != EOK)
    205205                goto error;
    206206
  • uspace/app/bdsh/cmds/modules/mount/mount.c

    r8610c2c rd5c1051  
    132132        const char *mopts = "";
    133133        const char *dev = "";
    134         int rc, c, opt_ind;
     134        int rc;
     135        int c, opt_ind;
    135136        unsigned int instance = 0;
    136137        bool instance_set = false;
  • uspace/app/bdsh/cmds/modules/rm/rm.c

    r8610c2c rd5c1051  
    209209        rc = vfs_unlink_path(path);
    210210        if (rc == EOK)
    211                 return EOK;
     211                return 0;
    212212
    213213        cli_error(CL_ENOTSUP, "Can not remove %s", path);
  • uspace/app/bdsh/exec.c

    r8610c2c rd5c1051  
    9898        task_exit_t texit;
    9999        char *tmp;
    100         int rc, retval, i;
     100        int rc;
     101        int retval, i;
    101102        int file_handles[3] = { -1, -1, -1 };
    102103        FILE *files[3];
  • uspace/app/bdsh/test/toktest.c

    r8610c2c rd5c1051  
    4747
    4848        int rc = tok_init(&tokenizer, input_buffer, tokens, MAX_TOKENS);
    49         PCUT_ASSERT_INT_EQUALS(EOK, rc);
     49        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
    5050
    5151        size_t token_count;
    5252        rc = tok_tokenize(&tokenizer, &token_count);
    53         PCUT_ASSERT_INT_EQUALS(EOK, rc);
     53        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
    5454
    5555
Note: See TracChangeset for help on using the changeset viewer.