r22532 - in /desktop/unstable/gnome-applets/debian: changelog patches/15_path-max.patch patches/series

pochu at users.alioth.debian.org pochu at users.alioth.debian.org
Mon Dec 7 16:33:39 UTC 2009


Author: pochu
Date: Mon Dec  7 16:33:38 2009
New Revision: 22532

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=22532
Log:
* debian/patches/15_path-max.patch:
  - Avoid using PATH_MAX since it's not necessarily defined. Fixes a build
    issue on the Hurd.

Added:
    desktop/unstable/gnome-applets/debian/patches/15_path-max.patch
Modified:
    desktop/unstable/gnome-applets/debian/changelog
    desktop/unstable/gnome-applets/debian/patches/series

Modified: desktop/unstable/gnome-applets/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-applets/debian/changelog?rev=22532&op=diff
==============================================================================
--- desktop/unstable/gnome-applets/debian/changelog [utf-8] (original)
+++ desktop/unstable/gnome-applets/debian/changelog [utf-8] Mon Dec  7 16:33:38 2009
@@ -1,3 +1,11 @@
+gnome-applets (2.28.0-3) unstable; urgency=low
+
+  * debian/patches/15_path-max.patch:
+    - Avoid using PATH_MAX since it's not necessarily defined. Fixes a build
+      issue on the Hurd.
+
+ -- Emilio Pozuelo Monfort <pochu at debian.org>  Mon, 07 Dec 2009 17:32:12 +0100
+
 gnome-applets (2.28.0-2) unstable; urgency=low
 
   * Upload to unstable.

Added: desktop/unstable/gnome-applets/debian/patches/15_path-max.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-applets/debian/patches/15_path-max.patch?rev=22532&op=file
==============================================================================
--- desktop/unstable/gnome-applets/debian/patches/15_path-max.patch (added)
+++ desktop/unstable/gnome-applets/debian/patches/15_path-max.patch [utf-8] Mon Dec  7 16:33:38 2009
@@ -1,0 +1,58 @@
+From beada5329098bb50f7b0dca3e96b577b9e3de3eb Mon Sep 17 00:00:00 2001
+From: Emilio Pozuelo Monfort <pochu27 at gmail.com>
+Date: Mon, 7 Dec 2009 17:18:35 +0100
+Subject: [PATCH] Bug 603997: Don't unconditionally use PATH_MAX
+
+Since PATH_MAX is not guaranteed to be defined, unconditionally
+using it will cause a build failure on platforms that don't define
+it. So stop using it and use dynamic allocation to achieve the same
+result.
+---
+ multiload/linux-proc.c |   28 ++++++++++++++++------------
+ 1 files changed, 16 insertions(+), 12 deletions(-)
+
+diff --git a/multiload/linux-proc.c b/multiload/linux-proc.c
+index e168722..5782eec 100644
+--- a/multiload/linux-proc.c
++++ b/multiload/linux-proc.c
+@@ -288,21 +288,25 @@ is_net_device_virtual(char *device)
+      * /sys/class/net/name-of-dev/ .  This second method is more complex
+      * but more reliable.
+      */
+-    char path[PATH_MAX];
++    gboolean ret = FALSE;
++    char *path = malloc (strlen (device) + strlen ("/sys/class/net//device") + 1);
+ 
+     /* Check if /sys/class/net/name-of-dev/ exists (may be old linux kernel
+      * or not linux at all). */
+-    if (sprintf(path, "/sys/class/net/%s", device) < 0)
+-        return FALSE;
+-    if (access(path, F_OK) != 0)
+-        return FALSE; /* unknown */
+-
+-    if (sprintf(path, "/sys/class/net/%s/device", device) < 0)
+-        return FALSE;
+-    if (access(path, F_OK) != 0)
+-        return TRUE;
+-
+-    return FALSE;
++    do {
++        if (sprintf(path, "/sys/class/net/%s", device) < 0)
++            break;
++        if (access(path, F_OK) != 0)
++            break; /* unknown */
++
++        if (sprintf(path, "/sys/class/net/%s/device", device) < 0)
++            break;
++        if (access(path, F_OK) != 0)
++            ret = TRUE;
++    } while (0);
++
++    free (path);
++    return ret;
+ }
+ 
+ void
+-- 
+1.6.5.4
+

Modified: desktop/unstable/gnome-applets/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-applets/debian/patches/series?rev=22532&op=diff
==============================================================================
--- desktop/unstable/gnome-applets/debian/patches/series [utf-8] (original)
+++ desktop/unstable/gnome-applets/debian/patches/series [utf-8] Mon Dec  7 16:33:38 2009
@@ -1,4 +1,5 @@
 09_modemlights_use_new_gst.patch
 10_network-manager.patch
+15_path-max.patch
 98_autoreconf.patch
 99_ltmain_as-needed.patch




More information about the pkg-gnome-commits mailing list