Hi Dave,
applying the patch i get the following problem:
edsiper@monotop:~/coding/monkey$ git apply 0001-Fix-wrong-exit-code.patch
0001-Fix-wrong-exit-code.patch:56: trailing whitespace.
mk_utils_register_pid();
error: patch failed: src/monkey.c:86
error: src/monkey.c: patch does not apply
please check and resend, it looks good :)
best,
On Mon, Feb 7, 2011 at 6:56 PM, Davidlohr Bueso <[email protected]> wrote:
> From: Davidlohr Bueso <[email protected]>
>
> When passing an invalid option to monkey we should be returning an
> EXIT_FAILURE code indicating the wrong status.
> ---
> src/monkey.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/src/monkey.c b/src/monkey.c
> index 7d0a9e2..5640abb 100644
> --- a/src/monkey.c
> +++ b/src/monkey.c
> @@ -86,7 +86,7 @@ void mk_version()
> fflush(stdout);
> }
>
> -void mk_help()
> +void mk_help(int rc)
> {
> printf("Usage : monkey [-c directory] [-D] [-v] [-h]\n\n");
> printf("Available options:\n");
> @@ -94,7 +94,7 @@ void mk_help()
> printf(" -D\t\trun Monkey as daemon\n");
> printf(" -v\t\tshow version number\n");
> printf(" -h\t\tprint this help\n\n");
> - exit(EXIT_SUCCESS);
> + exit(rc);
> }
>
> /* MAIN */
> @@ -123,7 +123,7 @@ int main(int argc, char **argv)
> exit(EXIT_SUCCESS);
> break;
> case 'h':
> - mk_help();
> + mk_help(EXIT_SUCCESS);
> break;
> case 'D':
> config->is_daemon = VAR_ON;
> @@ -135,7 +135,7 @@ int main(int argc, char **argv)
> }
> case '?':
> printf("Monkey: Invalid option or option needs an
> argument.\n");
> - mk_help();
> + mk_help(EXIT_FAILURE);
> break;
> }
> }
> @@ -167,7 +167,7 @@ int main(int argc, char **argv)
> mk_utils_worker_spawn((void *) mk_clock_worker_init);
>
> /* Register PID of Monkey */
> - mk_utils_register_pid();
> + mk_utils_register_pid();
>
> /* Init mk pointers */
> mk_mem_pointers_init();
> --
> 1.7.1
>
>
>
--
Eduardo Silva
http://edsiper.linuxchile.cl
http://www.monkey-project.com
_______________________________________________
Monkey mailing list
[email protected]
http://lists.monkey-project.com/listinfo/monkey