summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6be7429)
raw | patch | inline | side by side (parent: 6be7429)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 1 Jun 2009 10:55:30 +0000 (12:55 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 1 Jun 2009 10:55:30 +0000 (12:55 +0200) |
This patch fixes a FTBFS on Hurd.
Thanks to Marc Dequènes for reporting this and providing a patch.
Closes: #530814
Thanks to Marc Dequènes for reporting this and providing a patch.
Closes: #530814
debian/changelog | patch | blob | history | |
debian/patches/bts530814-hurd | [new file with mode: 0644] | patch | blob |
debian/patches/series | patch | blob | history |
diff --git a/debian/changelog b/debian/changelog
index c5c32620c99f6af50069158cd36ca90e27d49caf..7dbaa62b66d56cd5a948ebb21013bc2ad36f6ac5 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
* New upstream release:
- Fixed various memory leaks in the Python bindings, thanks to Anders
Hammarquist for reporting this and providing a patch (Closes: #529291).
+ * debian/patches:
+ - Added bts530814-hurd to fix a FTBFS on Hurd, thanks to Marc Dequènes for
+ reporting this and providing a patch (Closes: #530814).
- -- Sebastian Harl <tokkee@debian.org> Mon, 01 Jun 2009 12:32:13 +0200
+ -- Sebastian Harl <tokkee@debian.org> Mon, 01 Jun 2009 12:52:15 +0200
rrdtool (1.3.7-1) unstable; urgency=low
diff --git a/debian/patches/bts530814-hurd b/debian/patches/bts530814-hurd
--- /dev/null
@@ -0,0 +1,69 @@
+diff a/src/rrd_graph.c /src/rrd_graph.c
+--- a/src/rrd_graph.c
++++ b/src/rrd_graph.c
+@@ -3697,6 +3697,7 @@
+ image_desc_t im;
+ rrd_info_t *grinfo;
+ rrd_graph_init(&im);
++ size_t graphfile_len;
+ /* a dummy surface so that we can measure text sizes for placements */
+
+ rrd_graph_options(argc, argv, &im);
+@@ -3713,7 +3714,9 @@
+ return NULL;
+ }
+
+- if (strlen(argv[optind]) >= MAXPATH) {
++ graphfile_len = strlen(argv[optind]);
++#ifdef MAXPATH
++ if (graphfile_len >= MAXPATH) {
+ rrd_set_error("filename (including path) too long");
+ rrd_info_free(im.grinfo);
+ im_free(&im);
+@@ -3722,6 +3725,16 @@
+
+ strncpy(im.graphfile, argv[optind], MAXPATH - 1);
+ im.graphfile[MAXPATH - 1] = '\0';
++#else
++ im.graphfile = malloc(graphfile_len + 1);
++ if (im.graphfile == NULL) {
++ rrd_set_error("cannot allocate sufficient memory for filename length");
++ rrd_info_free(im.grinfo);
++ im_free(&im);
++ return NULL;
++ }
++ strncpy(im.graphfile, argv[optind], graphfile_len + 1);
++#endif
+
+ if (strcmp(im.graphfile, "-") == 0) {
+ im.graphfile[0] = '\0';
+diff a/src/rrd_graph.h b/src/rrd_graph.h
+--- a/src/rrd_graph.h
++++ b/src/rrd_graph.h
+@@ -196,7 +196,11 @@
+
+ /* configuration of graph */
+
++#ifdef MAXPATH
+ char graphfile[MAXPATH]; /* filename for graphic */
++#else
++ char *graphfile; /* filename for graphic */
++#endif
+ long xsize, ysize; /* graph area size in pixels */
+ struct gfx_color_t graph_col[__GRC_END__]; /* real colors for the graph */
+ text_prop_t text_prop[TEXT_PROP_LAST]; /* text properties */
+diff a/src/rrd_tool.c b/src/rrd_tool.c
+--- a/src/rrd_tool.c
++++ b/src/rrd_tool.c
+@@ -555,7 +555,11 @@
+ printf("ERROR: invalid parameter count for pwd\n");
+ return (1);
+ }
++#ifdef __GLIBC__
++ cwd = get_current_dir_name();
++#else
+ cwd = getcwd(NULL, MAXPATH);
++#endif
+ if (cwd == NULL) {
+ printf("ERROR: getcwd %s\n", rrd_strerror(errno));
+ return (1);
diff --git a/debian/patches/series b/debian/patches/series
index ae66800ab04431d54822698b668c668d5619bedf..7eb25d966e2efb0c52e5125385e77236d5bc7669 100644 (file)
--- a/debian/patches/series
+++ b/debian/patches/series
implicit-decl-fix
compiler-warning-fixes
doc-fixes
+bts530814-hurd