File 0025-daemon-Use-prog_exists-to-check-for-features.patch of Package libguestfs

From bc795049a43fcbce1958243b2ec90e582a482c0a Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones@redhat.com>
Date: Fri, 10 Dec 2010 17:38:17 +0000
Subject: [PATCH 25/72] daemon: Use prog_exists to check for features.

This updates commit 0938509e0422363554023ab99381fd70a22a6e08.

Cherry picked from upstream commit 363978fa7fc055da380d31103c7de378a08b71fb.
---
 daemon/ntfs.c |    8 +++-----
 daemon/tar.c  |    5 ++---
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/daemon/ntfs.c b/daemon/ntfs.c
index 46b8333..a25fc38 100644
--- a/daemon/ntfs.c
+++ b/daemon/ntfs.c
@@ -1,5 +1,5 @@
 /* libguestfs - the guestfsd daemon
- * Copyright (C) 2009 Red Hat Inc.
+ * Copyright (C) 2009-2010 Red Hat Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,15 +31,13 @@
 int
 optgroup_ntfs3g_available (void)
 {
-  int r = access ("/bin/ntfs-3g.probe", X_OK);
-  return r == 0;
+  return prog_exists ("ntfs-3g.probe");
 }
 
 int
 optgroup_ntfsprogs_available (void)
 {
-  int r = access ("/usr/sbin/ntfsresize", X_OK);
-  return r == 0;
+  return prog_exists ("ntfsresize");
 }
 
 int
diff --git a/daemon/tar.c b/daemon/tar.c
index 072a566..2ddde88 100644
--- a/daemon/tar.c
+++ b/daemon/tar.c
@@ -1,5 +1,5 @@
 /* libguestfs - the guestfsd daemon
- * Copyright (C) 2009 Red Hat Inc.
+ * Copyright (C) 2009-2010 Red Hat Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -33,8 +33,7 @@
 int
 optgroup_xz_available (void)
 {
-  int r = access ("/usr/bin/xz", X_OK);
-  return r == 0;
+  return prog_exists ("xz");
 }
 
 /* Redirect errors from the tar command to the error file, then
-- 
1.7.1

openSUSE Build Service is sponsored by