exit.c 397 B

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