Changeset a35b458 in mainline for uspace/app/redir


Ignore:
Timestamp:
2018-03-02T20:10:49Z (8 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:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/redir/redir.c

    r3061bc1 ra35b458  
    5656        if (fclose(*stream))
    5757                return;
    58        
     58
    5959        *stream = NULL;
    60        
     60
    6161        int oldfd;
    6262        errno_t rc = vfs_lookup_open(path, WALK_REGULAR | flags, mode, &oldfd);
    6363        if (rc != EOK)
    6464                return;
    65        
     65
    6666        if (oldfd != fd) {
    6767                int newfd;
    6868                if (vfs_clone(oldfd, fd, false, &newfd) != EOK)
    6969                        return;
    70                
     70
    7171                assert(newfd == fd);
    7272
     
    7474                        return;
    7575        }
    76        
     76
    7777        *stream = fdopen(fd, fmode);
    7878}
     
    8989                return 0;
    9090        }
    91        
     91
    9292        int i;
    9393        for (i = 0; i < argc; i++)
    9494                args[i] = argv[i];
    95        
     95
    9696        args[argc] = NULL;
    97        
     97
    9898        rc = task_spawnv(&id, wait, argv[0], args);
    99        
     99
    100100        free(args);
    101        
     101
    102102        if (rc != EOK) {
    103103                fprintf(stderr, "%s: Error spawning %s (%s)\n", NAME, argv[0],
     
    105105                return 0;
    106106        }
    107        
     107
    108108        return id;
    109109}
     
    115115                return -1;
    116116        }
    117        
     117
    118118        int i;
    119119        for (i = 1; i < argc; i++) {
     
    146146                }
    147147        }
    148        
     148
    149149        if (i >= argc) {
    150150                usage();
    151151                return -5;
    152152        }
    153        
     153
    154154        /*
    155155         * FIXME: fdopen() should actually detect that we are opening a console
     
    160160        task_wait_t wait;
    161161        task_id_t id = spawn(&wait, argc - i, argv + i);
    162        
     162
    163163        if (id != 0) {
    164164                task_exit_t texit;
    165165                int retval;
    166166                task_wait(&wait, &texit, &retval);
    167                
     167
    168168                return retval;
    169169        }
    170        
     170
    171171        return -6;
    172172}
Note: See TracChangeset for help on using the changeset viewer.