summaryrefslogtreecommitdiff
path: root/dmake/msdos
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2007-10-15 14:43:15 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2007-10-15 14:43:15 +0000
commit760db9141b198bcaaa8252f41d8feeca7a007d50 (patch)
treed70ddd0a4d8169da9982ca87fee038934b7c668d /dmake/msdos
parent4d31021f5b75e9423d62c0cb0ba430cd7331e400 (diff)
INTEGRATION: CWS dmake411 (1.4.6); FILE MERGED
2007/10/06 14:33:06 vq 1.4.6.3: #i80598# Always issue a warning if the actual execution of a recipe line (this does not include sucessfully executed, but failing programs) fails. 2007/09/19 00:34:31 vq 1.4.6.2: #i81252# Add a new SHELLCMDQUOTE control macro. 2007/09/02 10:44:26 vq 1.4.6.1: #i67911# Wait with the deletion of temporary files until the target is completely made.
Diffstat (limited to 'dmake/msdos')
-rw-r--r--dmake/msdos/runargv.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/dmake/msdos/runargv.c b/dmake/msdos/runargv.c
index a04245ad0e88..11a5ebd4b066 100644
--- a/dmake/msdos/runargv.c
+++ b/dmake/msdos/runargv.c
@@ -1,4 +1,4 @@
-/* RCS $Id: runargv.c,v 1.4 2007-01-18 09:34:27 vg Exp $
+/* RCS $Id: runargv.c,v 1.5 2007-10-15 15:43:15 ihi Exp $
--
-- SYNOPSIS
-- Run a sub process.
@@ -38,7 +38,7 @@ CELLPTR target;
int group;
int last;
t_attr cmnd_attr; /* Attributes for current cmnd. */
-char *cmd;
+char **cmd; /* Simulate a reference to *cmd. */
{
int ignore = (cmnd_attr & A_IGNORE)!= 0; /* Ignore errors ('-'). */
int shell = (cmnd_attr & A_SHELL) != 0; /* Use shell ('+'). */
@@ -54,15 +54,13 @@ char *cmd;
char **argv;
int old_stdout = -1; /* For redirecting shell escapes */
int old_stderr = -1; /* and silencing @@-recipes */
+ char *tcmd = *cmd; /* For saver/easier string arithmetic on *cmd. */
if( Measure & M_RECIPE )
Do_profile_output( "s", M_RECIPE, target );
_add_child(target, ignore);
- /* remove leading whitespace */
- while( iswhite(*cmd) ) ++cmd;
-
/* redirect output for _exec_shell / @@-recipes. */
if( Is_exec_shell ) {
/* Add error checking? */
@@ -80,24 +78,25 @@ char *cmd;
}
/* Return immediately for empty line or noop command. */
- if ( !*cmd || /* empty line */
- ( strncmp(cmd, "noop", 4) == 0 && /* noop command */
- (iswhite(cmd[4]) || cmd[4] == '\0')) ) {
+ if ( !*tcmd || /* empty line */
+ ( strncmp(tcmd, "noop", 4) == 0 && /* noop command */
+ (iswhite(tcmd[4]) || tcmd[4] == '\0')) ) {
status = 0;
}
else if( !shell && /* internal echo only if not in shell */
- strncmp(cmd, "echo", 4) == 0 &&
- (iswhite(cmd[4]) || cmd[4] == '\0') ) {
- char *tstr = cmd+4;
+ strncmp(tcmd, "echo", 4) == 0 &&
+ (iswhite(tcmd[4]) || tcmd[4] == '\0') ) {
int nl = 1;
- while( iswhite(*tstr) ) ++tstr;
- if ( strncmp(tstr,"-n",2 ) == 0) {
+ tcmd = tcmd + 4;
+
+ while( iswhite(*tcmd) ) ++tcmd;
+ if ( strncmp(tcmd,"-n",2 ) == 0) {
nl = 0;
- tstr = tstr+2;
- while( iswhite(*tstr) ) ++tstr;
+ tcmd = tcmd+2;
+ while( iswhite(*tcmd) ) ++tcmd;
}
- printf("%s%s", tstr, nl ? "\n" : "");
+ printf("%s%s", tcmd, nl ? "\n" : "");
fflush(stdout);
status = 0;
}
@@ -117,7 +116,15 @@ char *cmd;
dup2(old_stderr, 2);
}
- if( status == -1 ) Error("%s: %s", argv[0], strerror(errno));
+ if( status == -1 ) {
+ /* spawnvpe failed */
+ fprintf(stderr, "%s: Error executing '%s': %s",
+ Pname, argv[0], strerror(errno) );
+ if( ignore||Continue ) {
+ fprintf(stderr, " (Ignored)" );
+ }
+ fprintf(stderr, "\n");
+ }
if( Measure & M_RECIPE )
Do_profile_output( "e", M_RECIPE, target );
@@ -170,7 +177,6 @@ _finished_child(status)
int status;
{
if( _valid == -1 ) return;
- Unlink_temp_files( _tg );
_valid = -1;
Handle_result( status, _ignore, _abort_flg, _tg );
}