Changeset 84a1a54 in mainline for uspace/app/download/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/app/download/main.c

    rcde999a r84a1a54  
    240240        if (ofile != NULL && fclose(ofile) != 0) {
    241241                printf("Error writing '%s'.\n", ofname);
    242                 return EIO;
    243         }
    244 
    245         return EOK;
     242                return EXIT_RC(EIO);
     243        }
     244
     245        return 0;
    246246error:
    247247        free(buf);
     
    252252        if (ofile != NULL)
    253253                fclose(ofile);
    254         return rc;
     254        return EXIT_RC(rc);
    255255}
    256256
Note: See TracChangeset for help on using the changeset viewer.