OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
4.8 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../rrdtool/rrdtool-1.2.19-rrd_dump.patch
  5. # Copyright (C) 2007 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. fix memmory problem in rrd_dump.c
  17. --- ./src/rrd_dump.c (Revision 1009)
  18. +++ ./src/rrd_dump.c (Revision 1010)
  19. @@ -115,39 +115,39 @@
  20. fprintf(out_file, "\t<lastupdate> %ld </lastupdate> <!-- %s -->\n\n",
  21. rrd.live_head->last_up,somestring);
  22. for(i=0;i<rrd.stat_head->ds_cnt;i++){
  23. - fprintf(out_file, "\t<ds>\n");
  24. - fprintf(out_file, "\t\t<name> %s </name>\n",rrd.ds_def[i].ds_nam);
  25. - fprintf(out_file, "\t\t<type> %s </type>\n",rrd.ds_def[i].dst);
  26. - if (dst_conv(rrd.ds_def[i].dst) != DST_CDEF) {
  27. - fprintf(out_file, "\t\t<minimal_heartbeat> %lu </minimal_heartbeat>\n",rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt);
  28. - if (isnan(rrd.ds_def[i].par[DS_min_val].u_val)){
  29. - fprintf(out_file, "\t\t<min> NaN </min>\n");
  30. - } else {
  31. - fprintf(out_file, "\t\t<min> %0.10e </min>\n",rrd.ds_def[i].par[DS_min_val].u_val);
  32. - }
  33. - if (isnan(rrd.ds_def[i].par[DS_max_val].u_val)){
  34. - fprintf(out_file, "\t\t<max> NaN </max>\n");
  35. - } else {
  36. - fprintf(out_file, "\t\t<max> %0.10e </max>\n",rrd.ds_def[i].par[DS_max_val].u_val);
  37. - }
  38. - } else { /* DST_CDEF */
  39. - char *str;
  40. - rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),rrd.ds_def,&str);
  41. - fprintf(out_file, "\t\t<cdef> %s </cdef>\n", str);
  42. - free(str);
  43. - }
  44. - fprintf(out_file, "\n\t\t<!-- PDP Status -->\n");
  45. - fprintf(out_file, "\t\t<last_ds> %s </last_ds>\n",rrd.pdp_prep[i].last_ds);
  46. - if (isnan(rrd.pdp_prep[i].scratch[PDP_val].u_val)){
  47. - fprintf(out_file, "\t\t<value> NaN </value>\n");
  48. - } else {
  49. - fprintf(out_file, "\t\t<value> %0.10e </value>\n",rrd.pdp_prep[i].scratch[PDP_val].u_val);
  50. - }
  51. - fprintf(out_file, "\t\t<unknown_sec> %lu </unknown_sec>\n",
  52. - rrd.pdp_prep[i].scratch[PDP_unkn_sec_cnt].u_cnt);
  53. + fprintf(out_file, "\t<ds>\n");
  54. + fprintf(out_file, "\t\t<name> %s </name>\n",rrd.ds_def[i].ds_nam);
  55. + fprintf(out_file, "\t\t<type> %s </type>\n",rrd.ds_def[i].dst);
  56. + if (dst_conv(rrd.ds_def[i].dst) != DST_CDEF) {
  57. + fprintf(out_file, "\t\t<minimal_heartbeat> %lu </minimal_heartbeat>\n",rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt);
  58. + if (isnan(rrd.ds_def[i].par[DS_min_val].u_val)){
  59. + fprintf(out_file, "\t\t<min> NaN </min>\n");
  60. + } else {
  61. + fprintf(out_file, "\t\t<min> %0.10e </min>\n",rrd.ds_def[i].par[DS_min_val].u_val);
  62. + }
  63. + if (isnan(rrd.ds_def[i].par[DS_max_val].u_val)){
  64. + fprintf(out_file, "\t\t<max> NaN </max>\n");
  65. + } else {
  66. + fprintf(out_file, "\t\t<max> %0.10e </max>\n",rrd.ds_def[i].par[DS_max_val].u_val);
  67. + }
  68. + } else { /* DST_CDEF */
  69. + char *str=NULL;
  70. + rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),rrd.ds_def,&str);
  71. + fprintf(out_file, "\t\t<cdef> %s </cdef>\n", str);
  72. + free(str);
  73. + }
  74. + fprintf(out_file, "\n\t\t<!-- PDP Status -->\n");
  75. + fprintf(out_file, "\t\t<last_ds> %s </last_ds>\n",rrd.pdp_prep[i].last_ds);
  76. + if (isnan(rrd.pdp_prep[i].scratch[PDP_val].u_val)){
  77. + fprintf(out_file, "\t\t<value> NaN </value>\n");
  78. + } else {
  79. + fprintf(out_file, "\t\t<value> %0.10e </value>\n",rrd.pdp_prep[i].scratch[PDP_val].u_val);
  80. + }
  81. + fprintf(out_file, "\t\t<unknown_sec> %lu </unknown_sec>\n",
  82. + rrd.pdp_prep[i].scratch[PDP_unkn_sec_cnt].u_cnt);
  83. - fprintf(out_file, "\t</ds>\n\n");
  84. - }
  85. + fprintf(out_file, "\t</ds>\n\n");
  86. + }
  87. fputs("<!-- Round Robin Archives -->", out_file);
  88. --- ./src/rrd_tune.c (Revision 1009)
  89. +++ ./src/rrd_tune.c (Revision 1010)
  90. @@ -290,7 +290,7 @@
  91. rrd.ds_def[i].par[DS_min_val].u_val,
  92. rrd.ds_def[i].par[DS_max_val].u_val);
  93. } else {
  94. - char *buffer;
  95. + char *buffer = NULL;
  96. rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),rrd.ds_def,&buffer);
  97. printf("DS[%s] typ: %s\tcdef: %s\n", rrd.ds_def[i].ds_nam,rrd.ds_def[i].dst,buffer);
  98. free(buffer);
  99. --- ./src/rrd_info.c (Revision 1009)
  100. +++ ./src/rrd_info.c (Revision 1010)
  101. @@ -117,7 +117,7 @@
  102. switch (current_ds) {
  103. case DST_CDEF:
  104. {
  105. - char *buffer = 0;
  106. + char *buffer = NULL;
  107. rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),
  108. rrd.ds_def, &buffer);
  109. info.u_str = buffer;