From: <oja...@us...> - 2007-01-16 09:53:14
|
Revision: 147 http://svn.sourceforge.net/sipp/?rev=147&view=rev Author: ojacques Date: 2007-01-16 01:53:13 -0800 (Tue, 16 Jan 2007) Log Message: ----------- Enh: print the actual location of the error log file and the error condition (if any) on creation - provided by Charles P. Wright from IBM Research Modified Paths: -------------- sipp/trunk/screen.cpp Modified: sipp/trunk/screen.cpp =================================================================== --- sipp/trunk/screen.cpp 2007-01-16 09:51:09 UTC (rev 146) +++ sipp/trunk/screen.cpp 2007-01-16 09:53:13 UTC (rev 147) @@ -29,8 +29,8 @@ #include <string.h> #include <signal.h> #include <screen.hpp> +#include <errno.h> - #ifdef __3PCC__ #include <unistd.h> extern int twinSippSocket; @@ -90,9 +90,9 @@ fprintf(stderr, "%s", screen_last_error); if(screen_errors > 1) { if (screen_logfile[0] != (char)0) { - fprintf(stderr, - "%s: There were more errors, see scenarioname_pid_errors.log file\n", - screen_exename); + fprintf(stderr, + "%s: There were more errors, see '%s' file\n", + screen_exename, screen_logfile); } else { fprintf(stderr, "%s: There were more errors, enable -trace_err to log them.\n", @@ -165,7 +165,7 @@ if (logfile_name == NULL) { screen_logfile[0] = (char)0; } else { - strcpy(screen_logfile, logfile_name); + strcpy(screen_logfile, logfile_name); } screen_exit_handler = exit_handler; @@ -200,8 +200,8 @@ if(screen_inited && (!screen_errorf) && screen_logfile[0] != (char)0) { screen_errorf = fopen(screen_logfile, "w"); if(!screen_errorf) { - c += sprintf(c, "%s: Unable to create '%s'.\n", - screen_exename, screen_logfile); + c += sprintf(c, "%s: Unable to create '%s': %s.\n", + screen_exename, screen_logfile, strerror(errno)); screen_exit(EXIT_FATAL_ERROR); } else { fprintf(screen_errorf, "%s: The following events occured:\n", @@ -216,8 +216,8 @@ fflush(output); } else if (fatal) { output = stderr; - fprintf(output, "%s", screen_last_error); - fflush(output); + fprintf(output, "%s", screen_last_error); + fflush(output); } if(fatal) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |