exit.c 406 B

1234567891011121314151617181920212223242526
  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(struct cmd_tbl *cmdtp, int flag, int argc,
  9. 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. );