Darcsweb-Url: 
http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=frugalware-0.5;a=darcs_commitdiff;h=20070116085414-dd049-c614422afd9abeccbf3aa6ce964fadbeb8199fa3.gz;

[libgtop-2.14.3-2siwenna1-x86_64
voroskoi <[EMAIL PROTECTED]>**20070116085414
 secfix relbump, closes #1626
 patch from crazy
] {
addfile ./source/gnome/libgtop/procmap_secfix+64bit_bugfix_backport.diff
hunk ./source/gnome/libgtop/FrugalBuild 1
-# Last modified: Wed, 06 Sep 2006 21:34:40 +0200
hunk ./source/gnome/libgtop/FrugalBuild 6
-pkgrel=1
+pkgrel=2siwenna1
hunk ./source/gnome/libgtop/FrugalBuild 14
-sha1sums=('68ed1f162f8ac3f8bb6e8b313c5ae9fda06ffe4d')
hunk ./source/gnome/libgtop/FrugalBuild 15
+source=([EMAIL PROTECTED] procmap_secfix+64bit_bugfix_backport.diff)
+sha1sums=('68ed1f162f8ac3f8bb6e8b313c5ae9fda06ffe4d' \
+         'd5eb0b47f1f52fe0bafa640f50ae120c6b9505af')
hunk ./source/gnome/libgtop/procmap_secfix+64bit_bugfix_backport.diff 1
+diff -Naur libgtop-2.14.3/sysdeps/linux/procmap.c 
libgtop-2.14.3-p/sysdeps/linux/procmap.c
+--- libgtop-2.14.3/sysdeps/linux/procmap.c     2006-02-04 11:33:08.000000000 
+0100
++++ libgtop-2.14.3-p/sysdeps/linux/procmap.c   2007-01-16 00:45:49.000000000 
+0100
+@@ -1,4 +1,4 @@
+-/* $Id: procmap.c,v 1.22 2006/01/23 16:41:10 bdejean Exp $ */
++/* $Id: procmap.c,v 1.23 2006/09/11 17:47:51 bdejean Exp $ */
+ 
+ /* Copyright (C) 1998-99 Martin Baulig
+    This file is part of LibGTop 1.0.
+@@ -38,9 +38,7 @@
+ #define SMAPS_FILE "/proc/%u/smaps"
+ 
+ 
+-#define PROC_MAPS_FORMAT ((sizeof(void*) == 8) \
+-? "%16lx-%16lx %4c %16lx %02hx:%02hx %lu%*[ ]%[^\n]\n" \
+-: "%08lx-%08lx %4c %08lx %02hx:%02hx %lu%*[ ]%[^\n]\n")
++#define PROC_MAPS_FORMAT "%16llx-%16llx %4c %16llx %02hx:%02hx %llu%*[ ]%n"
+ 
+ 
+ static const unsigned long _glibtop_sysdeps_proc_map =
+@@ -134,6 +132,8 @@
+       FILE *maps;
+       const char *filename;
+       gboolean has_smaps;
++      char *line = NULL;
++      size_t line_size = 0;
+ 
+       glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_MAP, 0);
+ 
+@@ -154,32 +154,29 @@
+ 
+       while(TRUE)
+       {
+-              char line[1024];
+-
+               unsigned long perm = 0;
+-              int rv;
+               guint len;
++              int line_end;
+ 
+               unsigned short dev_major, dev_minor;
+-              unsigned long start, end, offset, inode;
++               guint64 start, end, offset, inode;
+               char flags[4];
+-              char filename [GLIBTOP_MAP_FILENAME_LEN+1];
++              char *filename;
+ 
+               glibtop_map_entry *entry;
+ 
+-              if (!fgets(line, sizeof line, maps))
++              if (getline(&line, &line_size, maps) == -1)
+                       break;
+ 
+               /* 8 arguments */
+-              rv = sscanf(line, PROC_MAPS_FORMAT,
+-                          &start, &end, flags, &offset,
+-                          &dev_major, &dev_minor, &inode, filename);
+-
+-              if(rv == EOF || rv < 7)
+-                break;
++              if (sscanf(line, PROC_MAPS_FORMAT,
++                         &start, &end, flags, &offset,
++                         &dev_major, &dev_minor, &inode, &line_end) == EOF)
++                      break;
+ 
+-              if(rv == 7) /* no filename */
+-                filename[0] = '\0';
++              g_assert(line_end < line_size);
++              filename = line + line_end;
++              g_strstrip(filename);
+ 
+               /* Compute access permissions. */
+ 
+@@ -206,12 +203,12 @@
+               entry = &g_array_index(entry_list, glibtop_map_entry, len);
+ 
+               entry->flags = _glibtop_sysdeps_map_entry;
+-              entry->start = (guint64) start;
+-              entry->end = (guint64) end;
+-              entry->offset = (guint64) offset;
+-              entry->perm = (guint64) perm;
+-              entry->device = (guint64) MKDEV(dev_major, dev_minor);
+-              entry->inode = (guint64) inode;
++               entry->start = start;
++               entry->end = end;
++               entry->offset = offset;
++               entry->perm = perm;
++               entry->device = MKDEV(dev_major, dev_minor);
++               entry->inode = inode;
+               g_strlcpy(entry->filename, filename, sizeof entry->filename);
+ 
+               if (has_smaps)
+@@ -219,6 +216,7 @@
+ 
+       }
+ 
++      free(line);
+       fclose (maps);
+ 
+       buf->flags = _glibtop_sysdeps_proc_map;
+diff -Naur libgtop-2.14.3/sysdeps/linux/procopenfiles.c 
libgtop-2.14.3-p/sysdeps/linux/procopenfiles.c
+--- libgtop-2.14.3/sysdeps/linux/procopenfiles.c       2005-12-12 
11:09:40.000000000 +0100
++++ libgtop-2.14.3-p/sysdeps/linux/procopenfiles.c     2007-01-16 
00:45:49.000000000 +0100
+@@ -58,7 +58,8 @@
+ parse_file(const char *filename, LineParser parser, GHashTable *dict)
+ {
+       FILE *f;
+-      char line[1024];
++      char *line = NULL;
++      size_t size = 0;
+ 
+       f = fopen(filename, "r");
+ 
+@@ -67,15 +68,16 @@
+               return;
+       }
+ 
++
+       /* skip the first line */
+-      if(!fgets(line, sizeof line, f)) goto eof;
++      if (getline(&line, &size, f) == -1)
++              goto eof;
+ 
+-      while(fgets(line, sizeof line, f))
+-      {
++      while (getline(&line, &size, f) != -1)
+               parser(dict, line);
+-      }
+ 
+  eof:
++      free(line);
+       fclose(f);
+ }
+ 
}
_______________________________________________
Frugalware-darcs mailing list
Frugalware-darcs@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-darcs

Reply via email to