Changeset b7fd2a0 in mainline for uspace/app/sysinst/sysinst.c


Ignore:
Timestamp:
2018-01-13T03:10:29Z (7 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:
a53ed3a
Parents:
36f0738
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

Although this is a massive commit, it is a simple text replacement, and thus
is very easy to verify. Simply do the following:

`
git checkout <this commit's hash>
git reset HEAD
git add .
tools/srepl '\berrno_t\b' int
git add .
tools/srepl '\bsys_errno_t\b' sysarg_t
git reset
git diff
`

While this doesn't ensure that the replacements are correct, it does ensure
that the commit doesn't do anything except those replacements. Since errno_t
is typedef'd to int in the usual case (and sys_errno_t to sysarg_t), even if
incorrect, this commit cannot change behavior.

File:
1 edited

Legend:

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

    r36f0738 rb7fd2a0  
    8585 * @return EOK on success or an error code
    8686 */
    87 static int sysinst_label_dev(const char *dev, char **pdev)
     87static errno_t sysinst_label_dev(const char *dev, char **pdev)
    8888{
    8989        fdisk_t *fdisk;
     
    9393        cap_spec_t cap;
    9494        service_id_t sid;
    95         int rc;
     95        errno_t rc;
    9696
    9797        printf("sysinst_label_dev(): get service ID '%s'\n", dev);
     
    154154 * @return EOK on success or an error code
    155155 */
    156 static int sysinst_fs_mount(const char *dev)
     156static errno_t sysinst_fs_mount(const char *dev)
    157157{
    158158        task_wait_t twait;
    159159        task_exit_t texit;
    160         int rc;
     160        errno_t rc;
    161161        int trc;
    162162
     
    193193 * @return EOK on success or an error code
    194194 */
    195 static int sysinst_copy_boot_files(void)
     195static errno_t sysinst_copy_boot_files(void)
    196196{
    197197        task_wait_t twait;
    198198        task_exit_t texit;
    199         int rc;
     199        errno_t rc;
    200200        int trc;
    201201
     
    260260 * @return EOK on success or an error code
    261261 */
    262 static int sysinst_copy_boot_blocks(const char *devp)
     262static errno_t sysinst_copy_boot_blocks(const char *devp)
    263263{
    264264        void *boot_img;
     
    272272        aoff64_t core_blocks;
    273273        grub_boot_blocklist_t *first_bl, *bl;
    274         int rc;
     274        errno_t rc;
    275275
    276276        printf("sysinst_copy_boot_blocks: Read boot block image.\n");
     
    355355 * @return EOK on success or an error code
    356356 */
    357 static int sysinst_install(const char *dev)
    358 {
    359         int rc;
     357static errno_t sysinst_install(const char *dev)
     358{
     359        errno_t rc;
    360360        char *pdev;
    361361
Note: See TracChangeset for help on using the changeset viewer.