Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
70c4fc41
Commit
70c4fc41
authored
Dec 17, 2002
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Dec 17, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better handling of errors while fork/execing.
Add verbose command line switch. Add -z defs at link stage, to catch missing symbols.
parent
8efafbde
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
winewrap.c
tools/winewrap.c
+17
-10
No files found.
tools/winewrap.c
View file @
70c4fc41
...
...
@@ -25,6 +25,7 @@
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/wait.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
...
...
@@ -75,7 +76,7 @@ static const char *app_loader_script =
static
char
*
output_name
;
static
char
**
lib_files
,
**
obj_files
;
static
int
nb_lib_files
,
nb_obj_files
;
static
int
debug
=
1
;
static
int
verbose
=
0
;
void
error
(
const
char
*
s
,
...)
{
...
...
@@ -111,22 +112,25 @@ char *strmake(const char *fmt, ...)
void
spawn
(
char
*
const
argv
[])
{
int
pid
,
status
,
i
;
int
pid
,
status
,
wret
,
i
;
if
(
debug
)
if
(
verbose
)
{
for
(
i
=
0
;
argv
[
i
];
i
++
)
printf
(
"%s "
,
argv
[
i
]);
printf
(
"
\n
"
);
}
if
((
pid
=
fork
())
==
0
)
execvp
(
argv
[
0
],
argv
);
else
if
(
waitpid
(
pid
,
&
status
,
0
)
>
0
)
else
if
(
pid
>
0
)
{
if
(
WIFEXITED
(
status
)
&&
WEXITSTATUS
(
status
)
==
0
)
return
;
while
(
pid
!=
(
wret
=
waitpid
(
pid
,
&
status
,
0
)))
if
(
wret
==
-
1
&&
errno
!=
EINTR
)
break
;
if
(
pid
==
wret
&&
WIFEXITED
(
status
)
&&
WEXITSTATUS
(
status
)
==
0
)
return
;
error
(
"%s failed."
,
argv
[
0
]);
}
perror
(
"Error:"
);
exit
(
1
);
exit
(
3
);
}
int
is_resource
(
const
char
*
file
)
...
...
@@ -173,7 +177,12 @@ int main(int argc, char **argv)
break
;
case
'm'
:
if
(
strcmp
(
"-mwindows"
,
argv
[
i
])
==
0
)
gui_mode
=
1
;
else
if
(
strcmp
(
"-mgui"
,
argv
[
i
])
==
0
)
gui_mode
=
1
;
else
error
(
"Unknown option %s
\n
"
,
argv
[
i
]);
break
;
case
'v'
:
/* verbose */
if
(
argv
[
i
][
2
]
==
0
)
verbose
=
1
;
break
;
case
'-'
:
if
(
argv
[
i
][
2
])
error
(
"No long option supported."
);
no_opt
=
1
;
...
...
@@ -202,14 +211,12 @@ int main(int argc, char **argv)
spec_args
[
j
++
]
=
strmake
(
"%s.c"
,
spec_name
);
spec_args
[
j
++
]
=
"--exe"
;
spec_args
[
j
++
]
=
output_name
;
spec_args
[
j
++
]
=
"-m"
;
spec_args
[
j
++
]
=
gui_mode
?
"gui"
:
"cui"
;
spec_args
[
j
++
]
=
gui_mode
?
"-mgui"
:
"-mcui"
;
for
(
i
=
0
;
i
<
nb_obj_files
;
i
++
)
spec_args
[
j
++
]
=
obj_files
[
i
];
spec_args
[
j
++
]
=
"-L"
WINEDLLS
;
for
(
i
=
0
;
i
<
nb_lib_files
;
i
++
)
spec_args
[
j
++
]
=
strmake
(
"-l%s"
,
lib_files
[
i
]);
spec_args
[
j
++
]
=
"-lmsvcrt"
;
spec_args
[
j
]
=
0
;
/* build gcc's argument list */
...
...
@@ -227,7 +234,7 @@ int main(int argc, char **argv)
j
=
0
;
link_args
[
j
++
]
=
"gcc"
;
link_args
[
j
++
]
=
"-shared"
;
link_args
[
j
++
]
=
"-Wl,-Bsymbolic"
;
link_args
[
j
++
]
=
"-Wl,-Bsymbolic
,-z,defs
"
;
link_args
[
j
++
]
=
"-lwine"
;
link_args
[
j
++
]
=
"-lm"
;
link_args
[
j
++
]
=
"-o"
;
...
...
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