improve logging in oaisim

- print current working directory
- print git version (if available)
- print security keys
  this last one is a security breach, but as of today
  it's not a problem
This commit is contained in:
Cedric Roux
2017-05-18 10:39:25 +02:00
parent 430a8c4e11
commit 5e323eefa2
3 changed files with 70 additions and 0 deletions
+16
View File
@@ -1188,6 +1188,15 @@ int T_port = 2021; /* default port to listen to to wait for the tracer */
int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */
#endif
static void print_current_directory(void)
{
char dir[8192]; /* arbitrary size (should be big enough) */
if (getcwd(dir, 8192) == NULL)
printf("ERROR getting working directory\n");
else
printf("working directory: %s\n", dir);
}
/*------------------------------------------------------------------------------*/
int
main (int argc, char **argv)
@@ -1195,6 +1204,8 @@ main (int argc, char **argv)
clock_t t;
print_current_directory();
start_background_system();
#ifdef SMBV
@@ -1350,6 +1361,11 @@ main (int argc, char **argv)
LOG_N(EMU,
">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU initialization done <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
#ifndef PACKAGE_VERSION
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
#endif
LOG_I(EMU, "Version: %s\n", PACKAGE_VERSION);
#if defined(ENABLE_ITTI)
// Handle signals until all tasks are terminated