Changeset 84a1a54 in mainline for uspace/app/kio/kio.c


Ignore:
Timestamp:
2018-01-04T20:47:53Z (6 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/app/kio/kio.c

    rcde999a r84a1a54  
    191191                fprintf(stderr, "%s: Unable to get number of kio pages\n",
    192192                    NAME);
    193                 return rc;
     193                return EXIT_RC(rc);
    194194        }
    195195       
     
    199199                fprintf(stderr, "%s: Unable to get kio physical address\n",
    200200                    NAME);
    201                 return rc;
     201                return EXIT_RC(rc);
    202202        }
    203203       
     
    209209        if (rc != EOK) {
    210210                fprintf(stderr, "%s: Unable to map kio\n", NAME);
    211                 return rc;
     211                return EXIT_RC(rc);
    212212        }
    213213       
     
    217217                fprintf(stderr, "%s: Unable to register kio notifications\n",
    218218                    NAME);
    219                 return rc;
     219                return EXIT_RC(rc);
    220220        }
    221221       
     
    224224                fprintf(stderr, "%s: Unable to create consumer fibril\n",
    225225                    NAME);
    226                 return ENOMEM;
     226                return EXIT_RC(ENOMEM);
    227227        }
    228228       
     
    230230        if (!input) {
    231231                fprintf(stderr, "%s: Could not create input\n", NAME);
    232                 return ENOMEM;
     232                return EXIT_RC(ENOMEM);
    233233        }
    234234
     
    253253                rc = EOK;
    254254
    255         return EOK;
     255        return EXIT_RC(rc);
    256256}
    257257
Note: See TracChangeset for help on using the changeset viewer.