hal: Branch 'master'
David Zeuthen
david at kemper.freedesktop.org
Tue Mar 27 10:10:22 PDT 2007
configure.in | 10 ++++++++++
tools/hal-storage-shared.c | 12 +++++-------
2 files changed, 15 insertions(+), 7 deletions(-)
New commits:
diff-tree 32f7eae981dd186ec5eb2a3fdeec1fc9c11c0436 (from 7bd4095673b35af8ce1b09b0f1e141ece2e8d7e5)
Author: David Zeuthen <davidz at redhat.com>
Date: Tue Mar 27 13:10:21 2007 -0400
specify path to eject at build time
Based on a patch from Gabriel C <nix.or.die at googlemail.com>.
diff --git a/configure.in b/configure.in
index 27f802c..009624e 100644
--- a/configure.in
+++ b/configure.in
@@ -141,6 +141,15 @@ AC_ARG_ENABLE(docbook-docs, [ --ena
AC_ARG_ENABLE(man-pages, [ --enable-man-pages build manual pages],enable_man_pages=$enableval,enable_man_pages=yes)
AM_CONDITIONAL(MAN_PAGES_ENABLED, test x$enable_man_pages = xyes)
+## eject
+AC_ARG_WITH(eject, [ --with-eject=<path> Specify eject program. (default /usr/bin/eject)])
+if test -z "$with_eject"; then
+ EJECT_PROGRAM=/usr/bin/eject
+else
+ EJECT_PROGRAM=$with_eject
+fi
+AC_SUBST(EJECT_PROGRAM)
+AC_DEFINE_UNQUOTED(EJECT_PROGRAM, "$EJECT_PROGRAM", [Eject program to use])
GTK_DOC_CHECK([1.3])
@@ -896,6 +905,7 @@ echo "
Group for HAL: ${HAL_GROUP}
hald pidfile: ${HALD_PID_FILE}
hald socket dir: ${HALD_SOCKET_DIR}
+ eject program: ${EJECT_PROGRAM}
OS backend: ${HALD_BACKEND}
diff --git a/tools/hal-storage-shared.c b/tools/hal-storage-shared.c
index 1dfecb3..26e7ccd 100644
--- a/tools/hal-storage-shared.c
+++ b/tools/hal-storage-shared.c
@@ -510,8 +510,6 @@ line_found:
g_free (mount_point_to_unmount);
}
-#define EJECT "/usr/bin/eject"
-
void
handle_eject (LibHalContext *hal_ctx,
#ifdef HAVE_POLKIT
@@ -583,9 +581,9 @@ try_open_excl_again:
bailout_if_drive_is_locked (hal_ctx, drive, invoked_by_syscon_name);
- /* construct arguments to EJECT (e.g. /usr/bin/eject) */
+ /* construct arguments to EJECT_PROGRAM (e.g. /usr/bin/eject) */
na = 0;
- args[na++] = EJECT;
+ args[na++] = EJECT_PROGRAM;
if (closetray) {
args[na++] = "-t";
}
@@ -607,13 +605,13 @@ try_open_excl_again:
&serr,
&exit_status,
&err)) {
- printf ("Cannot execute %s\n", EJECT);
- unknown_error ("Cannot spawn " EJECT);
+ printf ("Cannot execute %s\n", EJECT_PROGRAM);
+ unknown_error ("Cannot spawn " EJECT_PROGRAM);
}
/* check if eject was succesful */
if (exit_status != 0) {
- printf ("%s error %d, stdout='%s', stderr='%s'\n", EJECT, exit_status, sout, serr);
+ printf ("%s error %d, stdout='%s', stderr='%s'\n", EJECT_PROGRAM, exit_status, sout, serr);
unknown_error (serr);
}
More information about the hal-commit
mailing list