git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Erik Faye-Lund <kusmabite@gmail.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: GIT Mailing-list <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Ramkumar Ramachandra <artagnon@gmail.com>
Subject: Re: [PATCH v2 01/10] test-chmtime: Fix exit code on Windows
Date: Wed, 20 Nov 2013 15:00:06 +0100	[thread overview]
Message-ID: <CABPQNSYP-LzX9Truv4UmQrmYpo5fWbk1aYKpKKVaGL8POanWiQ@mail.gmail.com> (raw)
In-Reply-To: <ba3c59d26cfb23a8c71c66ef1d49c4dca55fc556.1370636706.git.j6t@kdbg.org>

On Fri, Jun 7, 2013 at 10:53 PM, Johannes Sixt <j6t@kdbg.org> wrote:
> MinGW's bash does not recognize an exit code -1 as failure. See also
> 47e3de0e (MinGW: truncate exit()'s argument to lowest 8 bits) and 2488df84
> (builtin run_command: do not exit with -1). Exit code 1 is good enough.
>
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
>  test-chmtime.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/test-chmtime.c b/test-chmtime.c
> index 02b42ba..2e601a8 100644
> --- a/test-chmtime.c
> +++ b/test-chmtime.c
> @@ -84,7 +84,7 @@ int main(int argc, const char *argv[])
>                 if (stat(argv[i], &sb) < 0) {
>                         fprintf(stderr, "Failed to stat %s: %s\n",
>                                 argv[i], strerror(errno));
> -                       return -1;
> +                       return 1;
>                 }
>
>  #ifdef WIN32
> @@ -92,7 +92,7 @@ int main(int argc, const char *argv[])
>                                 chmod(argv[i], sb.st_mode | S_IWUSR)) {
>                         fprintf(stderr, "Could not make user-writable %s: %s",
>                                 argv[i], strerror(errno));
> -                       return -1;
> +                       return 1;
>                 }
>  #endif
>
> @@ -107,7 +107,7 @@ int main(int argc, const char *argv[])
>                 if (utb.modtime != sb.st_mtime && utime(argv[i], &utb) < 0) {
>                         fprintf(stderr, "Failed to modify time on %s: %s\n",
>                                 argv[i], strerror(errno));
> -                       return -1;
> +                       return 1;
>                 }
>         }
>
> @@ -115,5 +115,5 @@ int main(int argc, const char *argv[])
>
>  usage:
>         fprintf(stderr, "usage: %s %s\n", argv[0], usage_str);
> -       return -1;
> +       return 1;
>  }
> --
> 1.8.3.rc1.32.g8b61cbb
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Hmmm. Perhaps we should do something like this?

diff --git a/compat/mingw.h b/compat/mingw.h
index 1f9ab5f..cbee8bd 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -462,7 +462,7 @@ static int mingw_main(c,v); \
 int main(c,v) \
 { \
  mingw_startup(); \
- return mingw_main(__argc, __argv); \
+ return mingw_main(__argc, __argv) & 0xff; \
 } \
 static int mingw_main(c,v)

  reply	other threads:[~2013-11-20 14:00 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-01  9:34 [PATCH 00/11] Increase test coverage on Windows by removing SYMLINKS from many tests Johannes Sixt
2013-06-01  9:34 ` [PATCH 01/11] test-chmtime: Fix exit code on Windows Johannes Sixt
2013-06-01  9:34 ` [PATCH 02/11] t2100: modernize style and unroll a loop of test cases Johannes Sixt
2013-06-01  9:34 ` [PATCH 03/11] t3010: modernize style Johannes Sixt
2013-06-01  9:34 ` [PATCH 04/11] tests: introduce test_ln_s and test_ln_s_add Johannes Sixt
2013-06-01 11:11   ` Ramkumar Ramachandra
2013-06-01 15:06     ` Johannes Sixt
2013-06-01 17:10       ` Ramkumar Ramachandra
2013-06-01  9:34 ` [PATCH 05/11] tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases) Johannes Sixt
2013-06-04 21:06   ` Junio C Hamano
2013-06-05 19:32     ` Johannes Sixt
2013-06-04 21:55   ` Junio C Hamano
2013-06-05 20:07     ` Johannes Sixt
2013-06-01  9:34 ` [PATCH 06/11] t0000: use test_ln_s_add to remove SYMLINKS prerequisite Johannes Sixt
2013-06-01  9:34 ` [PATCH 07/11] t2100: " Johannes Sixt
2013-06-04 22:04   ` Junio C Hamano
2013-06-05 20:23     ` Johannes Sixt
2013-06-01  9:34 ` [PATCH 08/11] t3030: " Johannes Sixt
2013-06-01  9:34 ` [PATCH 09/11] t3100: " Johannes Sixt
2013-06-01  9:34 ` [PATCH 10/11] t3509, t4023, t4114: " Johannes Sixt
2013-06-02 23:44   ` Junio C Hamano
2013-06-01  9:34 ` [PATCH 11/11] t6035: " Johannes Sixt
2013-06-07 20:53 ` [PATCH v2 00/10] Increase test coverage on Windows by removing SYMLINKS from many tests Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 01/10] test-chmtime: Fix exit code on Windows Johannes Sixt
2013-11-20 14:00     ` Erik Faye-Lund [this message]
2013-06-07 20:53   ` [PATCH v2 02/10] t3010: modernize style Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 03/10] tests: introduce test_ln_s_add Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 04/10] tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases) Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 05/10] t0000: use test_ln_s_add to remove SYMLINKS prerequisite Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 06/10] t3030: " Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 07/10] t3100: " Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 08/10] t3509, t4023, t4114: " Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 09/10] t6035: " Johannes Sixt
2013-06-07 20:53   ` [PATCH v2 10/10] t4011: " Johannes Sixt
2013-06-07 22:04   ` [PATCH v2 00/10] Increase test coverage on Windows by removing SYMLINKS from many tests Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABPQNSYP-LzX9Truv4UmQrmYpo5fWbk1aYKpKKVaGL8POanWiQ@mail.gmail.com \
    --to=kusmabite@gmail.com \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).