Changeset 84a1a54 in mainline for uspace/srv/bd/file_bd/file_bd.c


Ignore:
Timestamp:
2018-01-04T20:47:53Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
facacc71
Parents:
cde999a
Message:

Wrap returns of errno from main() with EXIT_RC().

Returns of error code from main() prevent type checking when errno_t
and int are considered incompatible. In order to avoid the philosophical
discussion of what should and shouldn't be returned for main(), we simply
wrap the error values and leave the answer to the question for future
generations to decide.

File:
1 edited

Legend:

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

    rcde999a r84a1a54  
    4747#include <stddef.h>
    4848#include <stdint.h>
     49#include <stdlib.h>
    4950#include <errno.h>
    5051#include <str_error.h>
     
    137138                printf("%s: Unable to register device '%s': %s.\n",
    138139                    NAME, device_name, str_error(rc));
    139                 return rc;
     140                return EXIT_RC(rc);
    140141        }
    141142
     
    143144        if (rc != EOK) {
    144145                printf("%s: Failed resolving category 'disk': %s\n", NAME, str_error(rc));
    145                 return rc;
     146                return EXIT_RC(rc);
    146147        }
    147148
     
    150151                printf("%s: Failed adding %s to category: %s",
    151152                    NAME, device_name, str_error(rc));
    152                 return rc;
     153                return EXIT_RC(rc);
    153154        }
    154155
Note: See TracChangeset for help on using the changeset viewer.