X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fguestfsd.c;h=4b91660d5e12bf3119da6daee0ee9af32ee2fe73;hb=0d5b38f1d957609f3f96739507f491a6672f01d5;hp=db0bff926de99cb89d4003e6c5ed3c9a9917aa42;hpb=9a8889e4d0c532b9f77af3a9cc7aae06adebfb83;p=libguestfs.git diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index db0bff9..4b91660 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -27,15 +27,27 @@ #include #include #include -#include #include -#include #include -#include #include #include #include + +#ifdef HAVE_NETDB_H +#include +#endif + +#ifdef HAVE_SYS_SELECT_H +#include +#endif + +#ifdef HAVE_SYS_WAIT_H +#include +#endif + +#ifdef HAVE_PRINTF_H #include +#endif #include "c-ctype.h" #include "ignore-value.h" @@ -976,5 +988,25 @@ device_name_translation (char *device, const char *func) void udev_settle (void) { - command (NULL, NULL, "/sbin/udevadm", "settle", NULL); + static int which_prog = 0; + + if (which_prog == 0) { + if (access ("/sbin/udevsettle", X_OK) == 0) + which_prog = 2; + else if (access ("/sbin/udevadm", X_OK) == 0) + which_prog = 1; + else + which_prog = 3; + } + + switch (which_prog) { + case 1: + command (NULL, NULL, "/sbin/udevadm", "settle", NULL); + break; + case 2: + command (NULL, NULL, "/sbin/udevsettle", NULL); + break; + default: + ; + } }