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

    rcde999a r84a1a54  
    128128{
    129129        if ((argc < 2) || (str_cmp(argv[1], "get-ns") == 0))
    130                 return dnscfg_print();
     130                return EXIT_RC(dnscfg_print());
    131131        else if (str_cmp(argv[1], "set-ns") == 0)
    132                 return dnscfg_set_ns(argc - 2, argv + 2);
     132                return EXIT_RC(dnscfg_set_ns(argc - 2, argv + 2));
    133133        else if (str_cmp(argv[1], "unset-ns") == 0)
    134                 return dnscfg_unset_ns();
     134                return EXIT_RC(dnscfg_unset_ns());
    135135        else {
    136136                printf("%s: Unknown command '%s'.\n", NAME, argv[1]);
Note: See TracChangeset for help on using the changeset viewer.