os: drop win32-only System() function
Not used anymore, so it can be dropped. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1778>
This commit is contained in:
parent
f837dee79d
commit
5b6f2292a3
|
@ -153,13 +153,11 @@ static inline void uname(struct utsname *uts) {
|
||||||
|
|
||||||
const char *Win32TempDir(void);
|
const char *Win32TempDir(void);
|
||||||
|
|
||||||
int System(const char *cmdline);
|
|
||||||
static inline void Fclose(void *f) { fclose(f); }
|
static inline void Fclose(void *f) { fclose(f); }
|
||||||
static inline void *Fopen(const char *a, const char *b) { return fopen(a,b); }
|
static inline void *Fopen(const char *a, const char *b) { return fopen(a,b); }
|
||||||
|
|
||||||
#else /* WIN32 */
|
#else /* WIN32 */
|
||||||
|
|
||||||
int System(const char *);
|
|
||||||
void *Popen(const char *, const char *);
|
void *Popen(const char *, const char *);
|
||||||
void *Fopen(const char *, const char *);
|
void *Fopen(const char *, const char *);
|
||||||
int Fclose(void *f);
|
int Fclose(void *f);
|
||||||
|
|
43
os/utils.c
43
os/utils.c
|
@ -1241,49 +1241,6 @@ Win32TempDir(void)
|
||||||
else
|
else
|
||||||
return "/tmp";
|
return "/tmp";
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
System(const char *cmdline)
|
|
||||||
{
|
|
||||||
STARTUPINFO si = (STARTUPINFO) {
|
|
||||||
.cb = sizeof(si),
|
|
||||||
};
|
|
||||||
PROCESS_INFORMATION pi = (PROCESS_INFORMATION){0};
|
|
||||||
DWORD dwExitCode;
|
|
||||||
char *cmd = strdup(cmdline);
|
|
||||||
|
|
||||||
if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
|
|
||||||
LPVOID buffer;
|
|
||||||
|
|
||||||
if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
|
||||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
|
||||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
|
||||||
NULL,
|
|
||||||
GetLastError(),
|
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
|
||||||
(LPTSTR) &buffer, 0, NULL)) {
|
|
||||||
ErrorF("[xkb] Starting '%s' failed!\n", cmdline);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ErrorF("[xkb] Starting '%s' failed: %s", cmdline, (char *) buffer);
|
|
||||||
LocalFree(buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(cmd);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
/* Wait until child process exits. */
|
|
||||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
|
||||||
|
|
||||||
GetExitCodeProcess(pi.hProcess, &dwExitCode);
|
|
||||||
|
|
||||||
/* Close process and thread handles. */
|
|
||||||
CloseHandle(pi.hProcess);
|
|
||||||
CloseHandle(pi.hThread);
|
|
||||||
free(cmd);
|
|
||||||
|
|
||||||
return dwExitCode;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
|
|
Loading…
Reference in New Issue