Skip to content

Commit

Permalink
- improve debugging messages for initvm
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Feb 17, 2014
1 parent b7f90d0 commit 2c6ec1f
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions initvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ enum okfail binfmt_register(char *datafile, char *regfile)

if (buf[0] != ':') /* non-data input line */
{
goto skip;
continue;
}

/* copy buf and tokenize :-seperated fields into f[] */
Expand All @@ -200,22 +200,24 @@ enum okfail binfmt_register(char *datafile, char *regfile)
{
fprintf(stderr, "%s: line %d: extra fields, ignoring."
" Content: %s", datafile, line, buf);
goto skip;
continue;
}

if (n < n_fields)
{
fprintf(stderr, "%s: line %d: missing fields, ignoring."
" Content: %s", datafile, line, buf);
goto skip;
continue;
}


if (access(f[interpreter], X_OK) != 0) {
int ret=access(f[interpreter], X_OK);
if (ret != 0) {
#ifdef DEBUG
fprintf(stderr,
"%s: line %d: interpreter '%s' not found,"
" ignoring\n", datafile, line, f[interpreter]);
goto skip;
" ignoring, return %d\n", datafile, line, f[interpreter], ret);
#endif /* DEBUG */
continue;
}

if (!write_file_string(regfile, buf)) {
Expand All @@ -238,9 +240,6 @@ enum okfail binfmt_register(char *datafile, char *regfile)

DBG(fprintf(stderr, "dumping: %s\n", path));
DBG(dump_file(path));

skip:
;
}


Expand Down Expand Up @@ -327,7 +326,7 @@ int main(int argc, char* argv[], char* env[])
exit(1);
}
execve(BUILD, args, env);
perror("execve");
perror("execve of "BUILD);
exit(1);
}

Expand Down

0 comments on commit 2c6ec1f

Please sign in to comment.