virObject parent;
char *binaryPath;
bool noRefresh;
- time_t mtime;
unsigned long version;
};
static int
dnsmasqCapsRefreshInternal(dnsmasqCaps *caps)
{
- struct stat sb;
g_autoptr(virCommand) vercmd = NULL;
g_autoptr(virCommand) helpcmd = NULL;
g_autofree char *help = NULL;
if (!caps || caps->noRefresh)
return 0;
- if (stat(caps->binaryPath, &sb) < 0) {
- virReportSystemError(errno, _("Cannot check dnsmasq binary %s"),
- caps->binaryPath);
- return -1;
- }
- if (caps->mtime == sb.st_mtime)
- return 0;
- caps->mtime = sb.st_mtime;
-
/* Make sure the binary we are about to try exec'ing exists.
* Technically we could catch the exec() failure, but that's
* in a sub-process so it's hard to feed back a useful error.