Re: [PATCH v10 04/14] run-command: add clean_on_exit_handler

2016-10-16 Thread Lars Schneider

> On 16 Oct 2016, at 01:03, Johannes Schindelin  
> wrote:
> 
> Hi Lars,
> 
> On Sat, 15 Oct 2016, Lars Schneider wrote:
> 
>> 
>>> On 11 Oct 2016, at 05:12, Johannes Schindelin  
>>> wrote:
>>> 
>>> On Windows, pid_t translates to long long int, resulting in this build
>>> error:
>>> 
>> 
>> Thanks for hint! I'll change it!
>> 
>> However, I am building on Win 8.1 with your latest SDK and I cannot
>> reproduce the error. Any idea why that might be the case?
> 
> Are you building with DEVELOPER=1?

Argh! Of course ... I forgot to add this flag to my config.mak on Windows.

Thanks,
Lars


Re: [PATCH v10 04/14] run-command: add clean_on_exit_handler

2016-10-16 Thread Johannes Schindelin
Hi Lars,

On Sat, 15 Oct 2016, Lars Schneider wrote:

> 
> > On 11 Oct 2016, at 05:12, Johannes Schindelin  
> > wrote:
> > 
> > Hi Lars,
> > 
> > On Sat, 8 Oct 2016, larsxschnei...@gmail.com wrote:
> > 
> >> @@ -31,6 +32,15 @@ static void cleanup_children(int sig, int in_signal)
> >>while (children_to_clean) {
> >>struct child_to_clean *p = children_to_clean;
> >>children_to_clean = p->next;
> >> +
> >> +  if (p->process && !in_signal) {
> >> +  struct child_process *process = p->process;
> >> +  if (process->clean_on_exit_handler) {
> >> +  trace_printf("trace: run_command: running exit 
> >> handler for pid %d", p->pid);
> > 
> > On Windows, pid_t translates to long long int, resulting in this build
> > error:
> > 
> > -- snip --
> > In file included from cache.h:10:0,
> >  from run-command.c:1:
> > run-command.c: In function 'cleanup_children':
> > run-command.c:39:18: error: format '%d' expects argument of type 'int', but 
> > argument 5 has type 'pid_t {aka long long int}' [-Werror=format=]
> >  trace_printf("trace: run_command: running exit handler for pid %d", 
> > p->pid);
> >   ^
> > trace.h:81:53: note: in definition of macro 'trace_printf'
> >   trace_printf_key_fl(TRACE_CONTEXT, __LINE__, NULL, __VA_ARGS__)
> >  ^~~
> > cc1.exe: all warnings being treated as errors
> > make: *** [Makefile:1987: run-command.o] Error 1
> > -- snap --
> > 
> > Maybe use PRIuMAX as we do elsewhere (see output of `git grep
> > printf.*pid`):
> > 
> > trace_printf("trace: run_command: running exit handler for pid %"
> >  PRIuMAX, (uintmax_t)p->pid);
> 
> Thanks for hint! I'll change it!
> 
> However, I am building on Win 8.1 with your latest SDK and I cannot
> reproduce the error. Any idea why that might be the case?

Are you building with DEVELOPER=1?

Ciao,
Dscho


Re: [PATCH v10 04/14] run-command: add clean_on_exit_handler

2016-10-15 Thread Lars Schneider

> On 11 Oct 2016, at 05:12, Johannes Schindelin  
> wrote:
> 
> Hi Lars,
> 
> On Sat, 8 Oct 2016, larsxschnei...@gmail.com wrote:
> 
>> @@ -31,6 +32,15 @@ static void cleanup_children(int sig, int in_signal)
>>  while (children_to_clean) {
>>  struct child_to_clean *p = children_to_clean;
>>  children_to_clean = p->next;
>> +
>> +if (p->process && !in_signal) {
>> +struct child_process *process = p->process;
>> +if (process->clean_on_exit_handler) {
>> +trace_printf("trace: run_command: running exit 
>> handler for pid %d", p->pid);
> 
> On Windows, pid_t translates to long long int, resulting in this build
> error:
> 
> -- snip --
> In file included from cache.h:10:0,
>  from run-command.c:1:
> run-command.c: In function 'cleanup_children':
> run-command.c:39:18: error: format '%d' expects argument of type 'int', but 
> argument 5 has type 'pid_t {aka long long int}' [-Werror=format=]
>  trace_printf("trace: run_command: running exit handler for pid %d", 
> p->pid);
>   ^
> trace.h:81:53: note: in definition of macro 'trace_printf'
>   trace_printf_key_fl(TRACE_CONTEXT, __LINE__, NULL, __VA_ARGS__)
>  ^~~
> cc1.exe: all warnings being treated as errors
> make: *** [Makefile:1987: run-command.o] Error 1
> -- snap --
> 
> Maybe use PRIuMAX as we do elsewhere (see output of `git grep
> printf.*pid`):
> 
>   trace_printf("trace: run_command: running exit handler for pid %"
>PRIuMAX, (uintmax_t)p->pid);

Thanks for hint! I'll change it!

However, I am building on Win 8.1 with your latest SDK and I cannot
reproduce the error. Any idea why that might be the case?

Thanks,
Lars



Re: [PATCH v10 04/14] run-command: add clean_on_exit_handler

2016-10-11 Thread Johannes Schindelin
Hi Lars,

On Sat, 8 Oct 2016, larsxschnei...@gmail.com wrote:

> @@ -31,6 +32,15 @@ static void cleanup_children(int sig, int in_signal)
>   while (children_to_clean) {
>   struct child_to_clean *p = children_to_clean;
>   children_to_clean = p->next;
> +
> + if (p->process && !in_signal) {
> + struct child_process *process = p->process;
> + if (process->clean_on_exit_handler) {
> + trace_printf("trace: run_command: running exit 
> handler for pid %d", p->pid);

On Windows, pid_t translates to long long int, resulting in this build
error:

-- snip --
 In file included from cache.h:10:0,
  from run-command.c:1:
 run-command.c: In function 'cleanup_children':
 run-command.c:39:18: error: format '%d' expects argument of type 'int', but 
argument 5 has type 'pid_t {aka long long int}' [-Werror=format=]
  trace_printf("trace: run_command: running exit handler for pid %d", 
p->pid);
   ^
 trace.h:81:53: note: in definition of macro 'trace_printf'
   trace_printf_key_fl(TRACE_CONTEXT, __LINE__, NULL, __VA_ARGS__)
  ^~~
 cc1.exe: all warnings being treated as errors
 make: *** [Makefile:1987: run-command.o] Error 1
-- snap --

Maybe use PRIuMAX as we do elsewhere (see output of `git grep
printf.*pid`):

trace_printf("trace: run_command: running exit handler for pid %"
 PRIuMAX, (uintmax_t)p->pid);

Ciao,
Dscho