Changeset 84a1a54 in mainline for uspace/app/corecfg/corecfg.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/corecfg/corecfg.c

    rcde999a r84a1a54  
    3636#include <errno.h>
    3737#include <stdio.h>
     38#include <stdlib.h>
    3839
    3940#define NAME "corecfg"
     
    7677                return corecfg_print();
    7778        else if (str_cmp(argv[1], "enable") == 0)
    78                 return corecfg_set_enable(true);
     79                return EXIT_RC(corecfg_set_enable(true));
    7980        else if (str_cmp(argv[1], "disable") == 0)
    80                 return corecfg_set_enable(false);
     81                return EXIT_RC(corecfg_set_enable(false));
    8182        else {
    8283                printf("%s: Unknown command '%s'.\n", NAME, argv[1]);
Note: See TracChangeset for help on using the changeset viewer.