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/wifi_supplicant/wifi_supplicant.c

    rcde999a r84a1a54  
    293293        if (argc == 2) {
    294294                if (!str_cmp(argv[1], "list"))
    295                         return wifi_list();
     295                        return EXIT_RC(wifi_list());
    296296        } else if (argc > 2) {
    297297                uint32_t index;
     
    300300                        printf("%s: Invalid argument.\n", NAME);
    301301                        print_syntax();
    302                         return EINVAL;
     302                        return EXIT_RC(EINVAL);
    303303                }
    304304               
     
    309309                                        now = true;
    310310                       
    311                         return wifi_scan(index, now);
     311                        return EXIT_RC(wifi_scan(index, now));
    312312                } else if (!str_cmp(argv[1], "connect")) {
    313313                        char *pass = NULL;
     
    316316                                        pass = argv[4];
    317317                               
    318                                 return wifi_connect(index, argv[3], pass);
     318                                return EXIT_RC(wifi_connect(index, argv[3], pass));
    319319                        }
    320320                } else if (!str_cmp(argv[1], "disconnect"))
    321                         return wifi_disconnect(index);
     321                        return EXIT_RC(wifi_disconnect(index));
    322322        }
    323323       
    324324        print_syntax();
    325325       
    326         return EOK;
     326        return 0;
    327327}
    328328
Note: See TracChangeset for help on using the changeset viewer.