Re: [PATCH 4/7] simple-ipc/ipc-win32: add trace2 debugging
- From
- Jeff Hostetler <git@jeffhostetler.com>
- Date
- Sep 17, 2021, 17:27 UTC
- Message-ID
- <c99ad8cb-3a95-3df3-3df4-240980e12ef1@jeffhostetler.com>
- In-Reply-To
- <87bl4tm5s1.fsf@evledraar.gmail.com>
On 9/16/21 1:40 AM, Ævar Arnfjörð Bjarmason wrote:
Show 16 quoted lines
>
> On Wed, Sep 15 2021, Jeff Hostetler via GitGitGadget wrote:
>
>> @@ -112,6 +115,11 @@ static enum ipc_active_state connect_to_server(
>> if (GetLastError() == ERROR_SEM_TIMEOUT)
>> return IPC_STATE__NOT_LISTENING;
>>
>> + gle = GetLastError();
>> + trace2_data_intmax("ipc-debug", NULL,
>> + "connect/waitpipe/gle",
>> + (intmax_t)gle);
>> +
>> return IPC_STATE__OTHER_ERROR;
>> }
>>
>... >
Show 15 quoted lines
> @@ -109,9 +109,12 @@ static enum ipc_active_state connect_to_server(
> t_start_ms = (DWORD)(getnanotime() / 1000000);
>
> if (!WaitNamedPipeW(wpath, timeout_ms)) {
> - if (GetLastError() == ERROR_SEM_TIMEOUT)
> + gle = GetLastError();
> + if (gle == ERROR_SEM_TIMEOUT)
> return IPC_STATE__NOT_LISTENING;
>
> + /* ...rest of your patch */
> +
> return IPC_STATE__OTHER_ERROR;
> }
>
> Yeah, I was just trying to minimize the size of the diff and at the time was considering those debug messages to be temporary, but I kind of like having them so it makes sense to clean up a bit as you've indicated.
Thanks Jeff