@@ -49,6 +49,9 @@ static enum ipc_active_state get_active_state(wchar_t *pipe_path)
49
49
if (GetLastError () == ERROR_FILE_NOT_FOUND )
50
50
return IPC_STATE__PATH_NOT_FOUND ;
51
51
52
+ trace2_data_intmax ("ipc-debug" , NULL , "getstate/waitpipe/gle" ,
53
+ (intmax_t )GetLastError ());
54
+
52
55
return IPC_STATE__OTHER_ERROR ;
53
56
}
54
57
@@ -109,9 +112,15 @@ static enum ipc_active_state connect_to_server(
109
112
t_start_ms = (DWORD )(getnanotime () / 1000000 );
110
113
111
114
if (!WaitNamedPipeW (wpath , timeout_ms )) {
112
- if (GetLastError () == ERROR_SEM_TIMEOUT )
115
+ DWORD gleWait = GetLastError ();
116
+
117
+ if (gleWait == ERROR_SEM_TIMEOUT )
113
118
return IPC_STATE__NOT_LISTENING ;
114
119
120
+ trace2_data_intmax ("ipc-debug" , NULL ,
121
+ "connect/waitpipe/gle" ,
122
+ (intmax_t )gleWait );
123
+
115
124
return IPC_STATE__OTHER_ERROR ;
116
125
}
117
126
@@ -133,17 +142,31 @@ static enum ipc_active_state connect_to_server(
133
142
break ; /* try again */
134
143
135
144
default :
145
+ trace2_data_intmax ("ipc-debug" , NULL ,
146
+ "connect/createfile/gle" ,
147
+ (intmax_t )gle );
148
+
136
149
return IPC_STATE__OTHER_ERROR ;
137
150
}
138
151
}
139
152
140
153
if (!SetNamedPipeHandleState (hPipe , & mode , NULL , NULL )) {
154
+ gle = GetLastError ();
155
+ trace2_data_intmax ("ipc-debug" , NULL ,
156
+ "connect/setpipestate/gle" ,
157
+ (intmax_t )gle );
158
+
141
159
CloseHandle (hPipe );
142
160
return IPC_STATE__OTHER_ERROR ;
143
161
}
144
162
145
163
* pfd = _open_osfhandle ((intptr_t )hPipe , O_RDWR |O_BINARY );
146
164
if (* pfd < 0 ) {
165
+ gle = GetLastError ();
166
+ trace2_data_intmax ("ipc-debug" , NULL ,
167
+ "connect/openosfhandle/gle" ,
168
+ (intmax_t )gle );
169
+
147
170
CloseHandle (hPipe );
148
171
return IPC_STATE__OTHER_ERROR ;
149
172
}
0 commit comments