Changeset 84a1a54 in mainline for uspace/lib/drv/generic/driver.c


Ignore:
Timestamp:
2018-01-04T20:47:53Z (7 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/lib/drv/generic/driver.c

    rcde999a r84a1a54  
    978978        if (rc != EOK) {
    979979                printf("Error: Failed to create driver port.\n");
    980                 return rc;
     980                return EXIT_RC(rc);
    981981        }
    982982       
     
    985985        if (rc != EOK) {
    986986                printf("Error: Failed to create devman port.\n");
    987                 return rc;
     987                return EXIT_RC(rc);
    988988        }
    989989       
     
    996996                    str_error(rc));
    997997               
    998                 return rc;
     998                return EXIT_RC(rc);
    999999        }
    10001000       
     
    10031003        if (rc != EOK) {
    10041004                printf("Error: Failed returning task value.\n");
    1005                 return rc;
     1005                return EXIT_RC(rc);
    10061006        }
    10071007       
     
    10091009       
    10101010        /* Never reached. */
    1011         return EOK;
     1011        return 0;
    10121012}
    10131013
Note: See TracChangeset for help on using the changeset viewer.