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

    rcde999a r84a1a54  
    3737#include <stdint.h>
    3838#include <stdio.h>
     39#include <stdlib.h>
    3940#include <task.h>
    4041#include <str_error.h>
     
    137138                        printf("%s: Error waiting on %s (%s)\n", APP_NAME, term,
    138139                            str_error(rc));
    139                         return rc;
     140                        return EXIT_RC(rc);
    140141                }
    141142        }
     
    174175                printf("%s: Error spawning %s (%s)\n", APP_NAME, cmd,
    175176                    str_error(rc));
    176                 return rc;
     177                return EXIT_RC(rc);
    177178        }
    178179       
     
    183184                printf("%s: Error waiting for %s (%s)\n", APP_NAME, cmd,
    184185                    str_error(rc));
    185                 return rc;
     186                return EXIT_RC(rc);
    186187        }
    187188       
Note: See TracChangeset for help on using the changeset viewer.