[Pkg-xfce-commits] r5666 - in goodies/trunk/xfce4-power-manager/debian: . patches

Yves-Alexis Perez corsac at alioth.debian.org
Fri Apr 22 03:44:24 UTC 2011


Author: corsac
Date: 2011-04-22 15:44:22 +0000 (Fri, 22 Apr 2011)
New Revision: 5666

Added:
   goodies/trunk/xfce4-power-manager/debian/patches/0001-Solaris-specific-code-for-determining-the-start-time.patch
   goodies/trunk/xfce4-power-manager/debian/patches/series
Modified:
   goodies/trunk/xfce4-power-manager/debian/changelog
Log:
* debian/patches:
  - 0001-Solaris-specific-code-for-determining-the-start-time cherry-picked
    from master. We don't have solaris but it should fix the build-failure
    on GNU/Hurd anyway.

Modified: goodies/trunk/xfce4-power-manager/debian/changelog
===================================================================
--- goodies/trunk/xfce4-power-manager/debian/changelog	2011-04-22 06:33:51 UTC (rev 5665)
+++ goodies/trunk/xfce4-power-manager/debian/changelog	2011-04-22 15:44:22 UTC (rev 5666)
@@ -1,3 +1,12 @@
+xfce4-power-manager (1.0.10-3) UNRELEASED; urgency=low
+
+  * debian/patches:
+    - 0001-Solaris-specific-code-for-determining-the-start-time cherry-picked
+      from master. We don't have solaris but it should fix the build-failure
+      on GNU/Hurd anyway.
+
+ -- Yves-Alexis Perez <corsac at debian.org>  Fri, 22 Apr 2011 17:40:48 +0200
+
 xfce4-power-manager (1.0.10-2) unstable; urgency=low
 
   [ Lionel Le Folgoc ]

Added: goodies/trunk/xfce4-power-manager/debian/patches/0001-Solaris-specific-code-for-determining-the-start-time.patch
===================================================================
--- goodies/trunk/xfce4-power-manager/debian/patches/0001-Solaris-specific-code-for-determining-the-start-time.patch	                        (rev 0)
+++ goodies/trunk/xfce4-power-manager/debian/patches/0001-Solaris-specific-code-for-determining-the-start-time.patch	2011-04-22 15:44:22 UTC (rev 5666)
@@ -0,0 +1,90 @@
+From 47b7e20d7acd2cc64caf379eb6cd385705d3e90d Mon Sep 17 00:00:00 2001
+From: Guido Berhoerster <gber at openindiana.org>
+Date: Mon, 28 Mar 2011 17:19:40 +0200
+Subject: [PATCH] Solaris-specific code for determining the start time of a
+ process.
+
+Solaris also allows to obtain this information through procfs,
+however design and implementation differ vastly from Linux.
+---
+ src/xfpm-polkit.c |   40 +++++++++++++++++++++++++++++++++++-----
+ 1 files changed, 35 insertions(+), 5 deletions(-)
+
+diff --git a/src/xfpm-polkit.c b/src/xfpm-polkit.c
+index a50c2db..29fcf7d 100644
+--- a/src/xfpm-polkit.c
++++ b/src/xfpm-polkit.c
+@@ -32,12 +32,15 @@
+ 
+ #include <sys/types.h>
+ 
+-#if defined(__FreeBSD__)
+-#include <sys/stat.h>
+-#else
++#if defined(__linux)
+ #include <sys/param.h>
+ #include <sys/sysctl.h>
+ #include <sys/user.h>
++#elif defined(__FreeBSD__)
++#include <sys/stat.h>
++#elif defined(__SVR4) || defined(__sun)
++#include <fcntl.h>
++#include <procfs.h>
+ #endif
+ 
+ #include <errno.h>
+@@ -115,7 +118,7 @@ static guint64
+ get_start_time_for_pid (pid_t pid)
+ {
+     guint64 start_time;
+-#if !defined(__FreeBSD__)
++#if defined(__linux)
+     gchar *filename;
+     gchar *contents;
+     size_t length;
+@@ -172,7 +175,7 @@ get_start_time_for_pid (pid_t pid)
+     g_free (filename);
+     g_free (contents);
+     
+-#else /*if !defined(__FreeBSD__)*/
++#elif defined(__FreeBSD__)
+ 
+     struct kinfo_proc p;
+     
+@@ -189,6 +192,33 @@ get_start_time_for_pid (pid_t pid)
+     start_time = (guint64) p.ki_start.tv_sec;
+     
+ out:
++#elif defined(__SVR4) || defined(__sun)
++
++    psinfo_t p;
++    gchar *filename;
++    int fd;
++
++    start_time = 0;
++
++    filename = g_strdup_printf ("/proc/%d/psinfo", (int) pid);
++    if ((fd = open(filename, O_RDONLY)) < 0)
++    {
++	g_warning ("Error opening %s (%s)",
++		   filename,
++		   g_strerror (errno));
++	goto out;
++    }
++    if (read(fd, &p, sizeof (p)) != sizeof (p))
++    {
++	g_warning ("Error reading %s",
++		   filename);
++	close(fd);
++	goto out;
++    }
++    start_time = (guint64) p.pr_start.tv_sec;
++    close(fd);
++out:
++    g_free (filename);
+ #endif
+     
+     return start_time;
+-- 
+1.7.4.4
+

Added: goodies/trunk/xfce4-power-manager/debian/patches/series
===================================================================
--- goodies/trunk/xfce4-power-manager/debian/patches/series	                        (rev 0)
+++ goodies/trunk/xfce4-power-manager/debian/patches/series	2011-04-22 15:44:22 UTC (rev 5666)
@@ -0,0 +1 @@
+0001-Solaris-specific-code-for-determining-the-start-time.patch




More information about the Pkg-xfce-commits mailing list