mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
build: check the path of fuser, and use it in FUSE code
Check for the full path of fuser, and use it instead of hardcoding /sbin/fuser (which is still left as fallback).
This commit is contained in:
@@ -348,11 +348,11 @@ do_fuser (const char *mountpoint)
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (pid == 0) { /* Child - run /sbin/fuser. */
|
||||
if (pid == 0) { /* Child - run fuser. */
|
||||
#ifdef __linux__
|
||||
execlp ("/sbin/fuser", "fuser", "-v", "-m", mountpoint, NULL);
|
||||
execlp (FUSER, "fuser", "-v", "-m", mountpoint, NULL);
|
||||
#else
|
||||
execlp ("/sbin/fuser", "fuser", "-c", mountpoint, NULL);
|
||||
execlp (FUSER, "fuser", "-c", mountpoint, NULL);
|
||||
#endif
|
||||
_exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ main (int argc, char *argv[])
|
||||
ignore_value (chdir ("/"));
|
||||
|
||||
/* Who's using the mountpoint? Should be no one. */
|
||||
snprintf (cmd, sizeof cmd, "/sbin/fuser %s", mountpoint);
|
||||
snprintf (cmd, sizeof cmd, "%s %s", FUSER, mountpoint);
|
||||
printf ("%s\n", cmd);
|
||||
fflush (stdout);
|
||||
ignore_value (system (cmd));
|
||||
|
||||
@@ -132,3 +132,7 @@ AS_IF([test "x$VALGRIND" != "xno"],[
|
||||
])
|
||||
AC_SUBST([VG])
|
||||
AM_SUBST_NOTMAKE([VG])
|
||||
|
||||
dnl Check for fuser (used in FUSE stuff).
|
||||
AC_PATH_PROGS([FUSER],[fuser],[/sbin/fuser])
|
||||
AC_DEFINE_UNQUOTED([FUSER],["$FUSER"],[Name of fuser program.])
|
||||
|
||||
Reference in New Issue
Block a user