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

    rcde999a r84a1a54  
    3535#include <mem.h>
    3636#include <stdio.h>
     37#include <stdlib.h>
    3738#include <task.h>
    3839
     
    114115        if (rc != EOK) {
    115116                printf("%s: Failed registering server.: %s\n", NAME, str_error(rc));
    116                 return rc;
     117                return EXIT_RC(rc);
    117118        }
    118119
     
    132133        if (rc != EOK) {
    133134                printf("%s: Failed registering service.: %s\n", NAME, str_error(rc));
    134                 return rc;
     135                return EXIT_RC(rc);
    135136        }
    136137
     
    138139        if (rc != EOK) {
    139140                printf("%s: Failed registering service.: %s\n", NAME, str_error(rc));
    140                 return rc;
     141                return EXIT_RC(rc);
    141142        }
    142143
     
    144145        if (rc != EOK) {
    145146                printf("%s: Failed registering service.: %s\n", NAME, str_error(rc));
    146                 return rc;
     147                return EXIT_RC(rc);
    147148        }
    148149
Note: See TracChangeset for help on using the changeset viewer.