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/hid/compositor/compositor.c

    rcde999a r84a1a54  
    22542254        if (rc != EOK) {
    22552255                printf("%s: Unable to register server (%s)\n", NAME, str_error(rc));
    2256                 return -1;
     2256                return rc;
    22572257        }
    22582258       
     
    22722272        char winreg[LOC_NAME_MAXLEN + 1];
    22732273        snprintf(winreg, LOC_NAME_MAXLEN, "%s%s/winreg", NAMESPACE, server_name);
    2274         if (loc_service_register(winreg, &winreg_id) != EOK) {
     2274        rc = loc_service_register(winreg, &winreg_id);
     2275        if (rc != EOK) {
    22752276                printf("%s: Unable to register service %s\n", NAME, winreg);
    2276                 return -1;
     2277                return rc;
    22772278        }
    22782279       
     
    23152316        int rc = compositor_srv_init(argv[1], argv[2]);
    23162317        if (rc != EOK)
    2317                 return rc;
     2318                return EXIT_RC(rc);
    23182319       
    23192320        printf("%s: Accepting connections\n", NAME);
Note: See TracChangeset for help on using the changeset viewer.