[xdebug-dev] xdebug xdebug/xdebug_profiler.c - Added some random number to the generated file names so that there is less

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Tue, 29 Aug 2006 18:43:20 +0200

Date: Tue Aug 29 18:43:20 CEST 2006
User: Derick Rethans
Directory: xdebug

Log Message:
[0.25]
- Added some random number to the generated file names so that there is less
  problems of concurrent requests writing to the same file.

Modified files:
           xdebug/xdebug_profiler.c (version: 1.41)

[FILE: /xdebug/xdebug_profiler.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- xdebug/xdebug_profiler.c:1.40 Tue Aug 29 07:18:54 2006 GMT
+++ xdebug/xdebug_profiler.c Tue Aug 29 14:43:20 2006 GMT
@@ -62,10 +62,10 @@
         char *script_name_tmp, *char_ptr;
 
         if (strcmp(XG(profiler_output_name), "crc32") == 0) {
- filename = xdebug_sprintf("%s/cachegrind.out.%lu", XG(profiler_output_dir), xdebug_crc32(script_name, strlen(script_name)));
+ filename = xdebug_sprintf("%s/cachegrind.out.%lu.%d", XG(profiler_output_dir), xdebug_crc32(script_name, strlen(script_name)), php_combined_lcg(TSRMLS_C));
         } else if (strcmp(XG(profiler_output_name), "timestamp") == 0) {
                 time_t the_time = time(NULL);
- filename = xdebug_sprintf("%s/cachegrind.out.%ld%d", XG(profiler_output_dir), the_time, php_combined_lcg(TSRMLS_C));
+ filename = xdebug_sprintf("%s/cachegrind.out.%ld.%d", XG(profiler_output_dir), the_time, php_combined_lcg(TSRMLS_C));
         } else if (strcmp(XG(profiler_output_name), "script") == 0) {
                 script_name_tmp = estrdup(script_name + 1);
                 /* replace slashes with underscores */
@@ -80,7 +80,7 @@
                 filename = xdebug_sprintf("%s/%s_cachegrind.out", XG(profiler_output_dir), script_name_tmp);
                 efree(script_name_tmp);
         } else {
- filename = xdebug_sprintf("%s/cachegrind.out.%ld", XG(profiler_output_dir), getpid());
+ filename = xdebug_sprintf("%s/cachegrind.out.%ld.%d", XG(profiler_output_dir), getpid(), php_combined_lcg(TSRMLS_C));
         }
 
         if (XG(profiler_append)) {
Received on Tue Aug 29 2006 - 18:43:22 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST