Changeset 84a1a54 in mainline for uspace/srv/devman/main.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/srv/devman/main.c

    rcde999a r84a1a54  
    320320        if (rc != EOK) {
    321321                printf("%s: Error initializing logging subsystem: %s\n", NAME, str_error(rc));
    322                 return rc;
     322                return EXIT_RC(rc);
    323323        }
    324324       
     
    332332        if (rc != EOK) {
    333333                printf("%s: Error creating DDF driver port: %s\n", NAME, str_error(rc));
    334                 return rc;
     334                return EXIT_RC(rc);
    335335        }
    336336       
     
    339339        if (rc != EOK) {
    340340                printf("%s: Error creating DDF client port: %s\n", NAME, str_error(rc));
    341                 return rc;
     341                return EXIT_RC(rc);
    342342        }
    343343       
     
    346346        if (rc != EOK) {
    347347                printf("%s: Error creating devman device port: %s\n", NAME, str_error(rc));
    348                 return rc;
     348                return EXIT_RC(rc);
    349349        }
    350350       
     
    353353        if (rc != EOK) {
    354354                printf("%s: Error creating devman parent port: %s\n", NAME, str_error(rc));
    355                 return rc;
     355                return EXIT_RC(rc);
    356356        }
    357357       
     
    367367        if (rc != EOK) {
    368368                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering as a service: %s", str_error(rc));
    369                 return rc;
     369                return EXIT_RC(rc);
    370370        }
    371371       
Note: See TracChangeset for help on using the changeset viewer.