wok diff ipxe/stuff/cmd_isgt.u @ rev 24986
Up nettle 3.7.3 again, need glib-networking rebuild to no break midori
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Wed May 11 08:28:28 2022 -0400 (2022-05-11) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ipxe/stuff/cmd_isgt.u Wed May 11 08:28:28 2022 -0400 1.3 @@ -0,0 +1,52 @@ 1.4 +--- src/core/exec.c 1.5 ++++ src/core/exec.c 1.6 +@@ -549,6 +549,49 @@ 1.7 + .exec = iseq_exec, 1.8 + }; 1.9 + 1.10 ++/** "isgt" options */ 1.11 ++struct isgt_options {}; 1.12 ++ 1.13 ++/** "isgt" option list */ 1.14 ++static struct option_descriptor isgt_opts[] = {}; 1.15 ++ 1.16 ++/** "isgt" command descriptor */ 1.17 ++static struct command_descriptor isgt_cmd = 1.18 ++ COMMAND_DESC ( struct isgt_options, isgt_opts, 2, 2, 1.19 ++ "<value1> <value2>" ); 1.20 ++ 1.21 ++/** 1.22 ++ * "isgt" command 1.23 ++ * 1.24 ++ * @v argc Argument count 1.25 ++ * @v argv Argument list 1.26 ++ * @ret rc Return status code 1.27 ++ */ 1.28 ++static int isgt_exec ( int argc, char **argv ) { 1.29 ++ struct isgt_options opts; 1.30 ++ unsigned int a, b; 1.31 ++ int rc; 1.32 ++ 1.33 ++ /* Parse options */ 1.34 ++ if ( ( rc = parse_options ( argc, argv, &isgt_cmd, &opts ) ) != 0 ) 1.35 ++ return rc; 1.36 ++ 1.37 ++ /* Parse numbers */ 1.38 ++ if ( ( rc = parse_integer ( argv[optind], &a ) ) != 0 ) 1.39 ++ return rc; 1.40 ++ if ( ( rc = parse_integer ( argv[optind + 1], &b ) ) != 0 ) 1.41 ++ return rc; 1.42 ++ 1.43 ++ /* Return success if a is greater than b */ 1.44 ++ return ( ( a > b ) ? 0 : -ERANGE ); 1.45 ++} 1.46 ++ 1.47 ++/** "isgt" command */ 1.48 ++struct command isgt_command __command = { 1.49 ++ .name = "isgt", 1.50 ++ .exec = isgt_exec, 1.51 ++}; 1.52 ++ 1.53 + /** "sleep" options */ 1.54 + struct sleep_options {}; 1.55 +