Ticket #274: 0001-Update-systemd-check-to-current-upstream-version.patch

File 0001-Update-systemd-check-to-current-upstream-version.patch, 1.0 KB (added by martin.pitt, 11 years ago)

patch

  • src/openvpn/console.c

    From fcf8ae2a0e2eb6a5e13d559e9a06566189fd1189 Mon Sep 17 00:00:00 2001
    From: Martin Pitt <martinpitt@gnome.org>
    Date: Thu, 21 Mar 2013 17:45:46 +0100
    Subject: [PATCH] Update systemd check to current upstream version
    
    Update check_systemd_running() to what upstream's sd_booted() does, to avoid
    recognizing logind without systemd as "systemd booted".
    
    http://cgit.freedesktop.org/systemd/systemd/commit/?id=66e411811b8090
    ---
     src/openvpn/console.c | 9 ++-------
     1 file changed, 2 insertions(+), 7 deletions(-)
    
    diff --git a/src/openvpn/console.c b/src/openvpn/console.c
    index afda8ca..30313cf 100644
    a b check_systemd_running () 
    145145{
    146146  struct stat a, b;
    147147
    148   /* We simply test whether the systemd cgroup hierarchy is
    149    * mounted */
    150 
    151   return (lstat("/sys/fs/cgroup", &a) == 0)
    152           && (lstat("/sys/fs/cgroup/systemd", &b) == 0)
    153           && (a.st_dev != b.st_dev);
    154 
     148  /* mirror what upstream sd_booted() does */
     149  return (access("/run/systemd/system", F_OK) >= 0);
    155150}
    156151
    157152static bool