exit.c 400 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright 2000-2009
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <command.h>
  9. static int do_exit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  10. {
  11. int r;
  12. r = 0;
  13. if (argc > 1)
  14. r = simple_strtoul(argv[1], NULL, 10);
  15. return -r - 2;
  16. }
  17. U_BOOT_CMD(
  18. exit, 2, 1, do_exit,
  19. "exit script",
  20. ""
  21. );