Changeset 84a1a54 in mainline for uspace/srv/hid/isdv4_tablet/main.c


Ignore:
Timestamp:
2018-01-04T20:47:53Z (8 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/isdv4_tablet/main.c

    rcde999a r84a1a54  
    315315        if (rc != EOK) {
    316316                printf("%s: Unable to register driver.\n", NAME);
    317                 return rc;
     317                return EXIT_RC(rc);
    318318        }
    319319
    320320        service_id_t service_id;
    321321        char *service_name;
    322         rc = asprintf(&service_name, "mouse/isdv4-%" PRIun, svc_id);
    323         if (rc < 0) {
     322        if (asprintf(&service_name, "mouse/isdv4-%" PRIun, svc_id) < 0) {
    324323                printf(NAME ": Unable to create service name\n");
    325                 return rc;
     324                return EXIT_RC(ENOMEM);
    326325        }
    327326
     
    329328        if (rc != EOK) {
    330329                printf(NAME ": Unable to register service %s.\n", service_name);
    331                 return rc;
     330                return EXIT_RC(rc);
    332331        }
    333332
Note: See TracChangeset for help on using the changeset viewer.