Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
29b55a5c
Commit
29b55a5c
authored
Jul 30, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jul 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineconsole: Consistently return nonzero exitcode on error.
parent
888ffb11
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
17 deletions
+19
-17
curses.c
programs/wineconsole/curses.c
+1
-1
user.c
programs/wineconsole/user.c
+1
-1
wineconsole.c
programs/wineconsole/wineconsole.c
+17
-15
No files found.
programs/wineconsole/curses.c
View file @
29b55a5c
...
...
@@ -1018,7 +1018,7 @@ static int WCCURSES_MainLoop(struct inner_data* data)
WCCURSES_Resize
(
data
);
if
(
pipe
(
PRIVATE
(
data
)
->
sync_pipe
)
==
-
1
)
return
0
;
if
(
pipe
(
PRIVATE
(
data
)
->
sync_pipe
)
==
-
1
)
return
1
;
PRIVATE
(
data
)
->
input_thread
=
CreateThread
(
NULL
,
0
,
input_thread
,
data
,
0
,
&
id
);
while
(
!
data
->
dying
&&
WaitForSingleObject
(
data
->
hSynchro
,
INFINITE
)
==
WAIT_OBJECT_0
)
...
...
programs/wineconsole/user.c
View file @
29b55a5c
...
...
@@ -1382,7 +1382,7 @@ static int WCUSER_MainLoop(struct inner_data* data)
* so GetMessage would lead to delayed processing */
while
(
PeekMessageW
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
{
if
(
msg
.
message
==
WM_QUIT
)
return
0
;
if
(
msg
.
message
==
WM_QUIT
)
return
1
;
WINE_TRACE
(
"dispatching msg %04x
\n
"
,
msg
.
message
);
DispatchMessageW
(
&
msg
);
}
...
...
programs/wineconsole/wineconsole.c
View file @
29b55a5c
...
...
@@ -720,7 +720,7 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna
*
* Spawn the child process when invoked with wineconsole foo bar
*/
static
BOOL
WINECON_Spawn
(
struct
inner_data
*
data
,
LPWSTR
cmdLine
)
static
int
WINECON_Spawn
(
struct
inner_data
*
data
,
LPWSTR
cmdLine
)
{
PROCESS_INFORMATION
info
;
STARTUPINFOW
startup
;
...
...
@@ -743,20 +743,22 @@ static BOOL WINECON_Spawn(struct inner_data* data, LPWSTR cmdLine)
{
WINE_ERR
(
"Can't dup handles
\n
"
);
/* no need to delete handles, we're exiting the program anyway */
return
FALSE
;
return
1
;
}
done
=
CreateProcessW
(
NULL
,
cmdLine
,
NULL
,
NULL
,
TRUE
,
0L
,
NULL
,
NULL
,
&
startup
,
&
info
);
if
(
done
)
{
CloseHandle
(
info
.
hProcess
);
CloseHandle
(
info
.
hThread
);
}
/* we no longer need the handles passed to the child for the console */
CloseHandle
(
startup
.
hStdInput
);
CloseHandle
(
startup
.
hStdOutput
);
CloseHandle
(
startup
.
hStdError
);
CloseHandle
(
info
.
hProcess
);
CloseHandle
(
info
.
hThread
);
return
done
;
return
!
done
;
}
struct
wc_init
{
...
...
@@ -852,9 +854,9 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, INT nCmdSh
{
case
from_event
:
/* case of wineconsole <evt>, signal process that created us that we're up and running */
if
(
!
(
data
=
WINECON_Init
(
hInst
,
0
,
NULL
,
wci
.
backend
,
nCmdShow
)))
return
0
;
ret
=
SetEvent
(
wci
.
event
);
if
(
!
ret
)
WINE_ERR
(
"SetEvent failed.
\n
"
);
if
(
!
(
data
=
WINECON_Init
(
hInst
,
0
,
NULL
,
wci
.
backend
,
nCmdShow
)))
return
1
;
ret
=
!
SetEvent
(
wci
.
event
);
if
(
ret
!=
0
)
WINE_ERR
(
"SetEvent failed.
\n
"
);
break
;
case
from_process_name
:
{
...
...
@@ -865,30 +867,30 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, INT nCmdSh
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
buffer
)
return
0
;
return
1
;
MultiByteToWideChar
(
CP_ACP
,
0
,
wci
.
ptr
,
-
1
,
buffer
,
len
);
if
(
!
(
data
=
WINECON_Init
(
hInst
,
GetCurrentProcessId
(),
buffer
,
wci
.
backend
,
nCmdShow
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
return
0
;
return
1
;
}
ret
=
WINECON_Spawn
(
data
,
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
if
(
!
ret
)
if
(
ret
!=
0
)
{
WINECON_Delete
(
data
);
printf_res
(
IDS_CMD_LAUNCH_FAILED
,
wine_dbgstr_a
(
wci
.
ptr
));
return
0
;
return
ret
;
}
}
break
;
default:
return
0
;
return
1
;
}
if
(
ret
)
if
(
!
ret
)
{
WINE_TRACE
(
"calling MainLoop.
\n
"
);
ret
=
data
->
fnMainLoop
(
data
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment