New upstream version 24.0.1+dfsg1
This commit is contained in:
parent
b14f9eae6d
commit
5a730d6ec3
842 changed files with 42245 additions and 33385 deletions
|
|
@ -43,7 +43,8 @@ static bool create_pipe(HANDLE *input, HANDLE *output)
|
|||
}
|
||||
|
||||
static inline bool create_process(const char *cmd_line, HANDLE stdin_handle,
|
||||
HANDLE stdout_handle, HANDLE stderr_handle, HANDLE *process)
|
||||
HANDLE stdout_handle, HANDLE stderr_handle,
|
||||
HANDLE *process)
|
||||
{
|
||||
PROCESS_INFORMATION pi = {0};
|
||||
wchar_t *cmd_line_w = NULL;
|
||||
|
|
@ -59,7 +60,8 @@ static inline bool create_process(const char *cmd_line, HANDLE stdin_handle,
|
|||
os_utf8_to_wcs_ptr(cmd_line, 0, &cmd_line_w);
|
||||
if (cmd_line_w) {
|
||||
success = !!CreateProcessW(NULL, cmd_line_w, NULL, NULL, true,
|
||||
CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
|
||||
CREATE_NO_WINDOW, NULL, NULL, &si,
|
||||
&pi);
|
||||
|
||||
if (success) {
|
||||
*process = pi.hProcess;
|
||||
|
|
@ -73,7 +75,7 @@ static inline bool create_process(const char *cmd_line, HANDLE stdin_handle,
|
|||
}
|
||||
|
||||
os_process_pipe_t *os_process_pipe_create(const char *cmd_line,
|
||||
const char *type)
|
||||
const char *type)
|
||||
{
|
||||
os_process_pipe_t *pp = NULL;
|
||||
bool read_pipe;
|
||||
|
|
@ -100,7 +102,7 @@ os_process_pipe_t *os_process_pipe_create(const char *cmd_line,
|
|||
read_pipe = *type == 'r';
|
||||
|
||||
success = !!SetHandleInformation(read_pipe ? input : output,
|
||||
HANDLE_FLAG_INHERIT, false);
|
||||
HANDLE_FLAG_INHERIT, false);
|
||||
if (!success) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -111,7 +113,8 @@ os_process_pipe_t *os_process_pipe_create(const char *cmd_line,
|
|||
}
|
||||
|
||||
success = create_process(cmd_line, read_pipe ? NULL : input,
|
||||
read_pipe ? output : NULL, err_output, &process);
|
||||
read_pipe ? output : NULL, err_output,
|
||||
&process);
|
||||
if (!success) {
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -174,7 +177,8 @@ size_t os_process_pipe_read(os_process_pipe_t *pp, uint8_t *data, size_t len)
|
|||
return 0;
|
||||
}
|
||||
|
||||
size_t os_process_pipe_read_err(os_process_pipe_t *pp, uint8_t *data, size_t len)
|
||||
size_t os_process_pipe_read_err(os_process_pipe_t *pp, uint8_t *data,
|
||||
size_t len)
|
||||
{
|
||||
DWORD bytes_read;
|
||||
bool success;
|
||||
|
|
@ -183,18 +187,18 @@ size_t os_process_pipe_read_err(os_process_pipe_t *pp, uint8_t *data, size_t len
|
|||
return 0;
|
||||
}
|
||||
|
||||
success = !!ReadFile(pp->handle_err, data, (DWORD)len, &bytes_read, NULL);
|
||||
success =
|
||||
!!ReadFile(pp->handle_err, data, (DWORD)len, &bytes_read, NULL);
|
||||
if (success && bytes_read) {
|
||||
return bytes_read;
|
||||
}
|
||||
else
|
||||
} else
|
||||
bytes_read = GetLastError();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t os_process_pipe_write(os_process_pipe_t *pp, const uint8_t *data,
|
||||
size_t len)
|
||||
size_t len)
|
||||
{
|
||||
DWORD bytes_written;
|
||||
bool success;
|
||||
|
|
@ -206,8 +210,8 @@ size_t os_process_pipe_write(os_process_pipe_t *pp, const uint8_t *data,
|
|||
return 0;
|
||||
}
|
||||
|
||||
success = !!WriteFile(pp->handle, data, (DWORD)len, &bytes_written,
|
||||
NULL);
|
||||
success =
|
||||
!!WriteFile(pp->handle, data, (DWORD)len, &bytes_written, NULL);
|
||||
if (success && bytes_written) {
|
||||
return bytes_written;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue