(file) Return to Fatal.c CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Executor

Diff for /pegasus/src/Executor/Fatal.c between version 1.1.2.4 and 1.1.2.5

version 1.1.2.4, 2007/01/12 00:34:38 version 1.1.2.5, 2007/01/12 23:09:06
Line 55 
Line 55 
  
 void Fatal(const char* file, size_t line, const char* format, ...) void Fatal(const char* file, size_t line, const char* format, ...)
 { {
     char buffer[EXECUTOR_BUFFER_SIZE];      char prefixedFormat[EXECUTOR_BUFFER_SIZE];
     char lineStr[32];     char lineStr[32];
  
     /* Prepend "__FILE__(__LINE__): FATAL: " to format. */     /* Prepend "__FILE__(__LINE__): FATAL: " to format. */
  
     Strlcpy(buffer, file, sizeof(buffer));      Strlcpy(prefixedFormat, file, sizeof(prefixedFormat));
     Strlcat(buffer, "(", sizeof(buffer));      Strlcat(prefixedFormat, "(", sizeof(prefixedFormat));
     sprintf(lineStr, "%u", (unsigned int)line);     sprintf(lineStr, "%u", (unsigned int)line);
     Strlcat(buffer, lineStr, sizeof(buffer));      Strlcat(prefixedFormat, lineStr, sizeof(prefixedFormat));
     Strlcat(buffer, "): FATAL: ", sizeof(buffer));      Strlcat(prefixedFormat, "): FATAL: ", sizeof(prefixedFormat));
     Strlcat(buffer,  format, sizeof(buffer));      Strlcat(prefixedFormat,  format, sizeof(prefixedFormat));
  
     /* Print to syslog. */     /* Print to syslog. */
     {     {
         va_list ap;         va_list ap;
           char buffer[EXECUTOR_BUFFER_SIZE];
   
         va_start(ap, format);         va_start(ap, format);
         vsyslog(LOG_CRIT, buffer, ap);          vsprintf(buffer, prefixedFormat, ap);
         va_end(ap);         va_end(ap);
   
           vsyslog(LOG_CRIT, buffer, ap);
     }     }
  
     /* Print to stderr. */     /* Print to stderr. */
Line 82 
Line 86 
         fprintf(stderr, "%s: ", globals.argv[0]);         fprintf(stderr, "%s: ", globals.argv[0]);
         va_start(ap, format);         va_start(ap, format);
         /* Flawfinder: ignore */         /* Flawfinder: ignore */
         vfprintf(stderr, buffer, ap);          vfprintf(stderr, prefixedFormat, ap);
         va_end(ap);         va_end(ap);
         fputc('\n', stderr);         fputc('\n', stderr);
     }     }


Legend:
Removed from v.1.1.2.4  
changed lines
  Added in v.1.1.2.5

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2