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

    rcde999a r84a1a54  
    4242#include <abi/ipc/interfaces.h>
    4343#include <stdio.h>
     44#include <stdlib.h>
    4445#include <errno.h>
    4546#include <macros.h>
     
    133134        int rc = service_init();
    134135        if (rc != EOK)
    135                 return rc;
     136                return EXIT_RC(rc);
    136137       
    137138        rc = clonable_init();
    138139        if (rc != EOK)
    139                 return rc;
     140                return EXIT_RC(rc);
    140141       
    141142        rc = task_init();
    142143        if (rc != EOK)
    143                 return rc;
     144                return EXIT_RC(rc);
    144145       
    145146        async_set_fallback_port_handler(ns_connection, NULL);
Note: See TracChangeset for help on using the changeset viewer.