Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
174 lines (151 sloc) 4.77 KB
diff -u -r a/configure.ac b/configure.ac
--- a/configure.ac 2010-04-30 16:16:44 +0000
+++ b/configure.ac 2010-05-01 10:48:40 +0000
@@ -78,7 +78,6 @@
VERSION_SCRIPT_FLAGS=-Wl,--version-script=
`$LD --help 2>&1 | grep -- --version-script >/dev/null` || \
VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
-AC_SUBST(VERSION_SCRIPT_FLAGS)
LIBVIRT_COMPILE_WARNINGS([maximum])
@@ -1824,10 +1823,11 @@
# from libvirt.syms and passes libvirt.def instead of libvirt.syms to the linker
LIBVIRT_SYMBOL_FILE=libvirt.def
# mingw's ld has the --version-script parameter, but it requires a .def file
- # instead to work properly, therefore clear --version-script here
+ # instead to work properly, therefore clear --version-script here and use
+ # -Wl, to pass the .def file to the linker
# cygwin's ld has the --version-script parameter too, but for some reason
# it's working there as expected
- VERSION_SCRIPT_FLAGS=
+ VERSION_SCRIPT_FLAGS="-Wl,"
;;
esac
AC_SUBST([CYGWIN_EXTRA_LDFLAGS])
@@ -1836,6 +1836,7 @@
AC_SUBST([MINGW_EXTRA_LDFLAGS])
AC_SUBST([WIN32_EXTRA_CFLAGS])
AC_SUBST([LIBVIRT_SYMBOL_FILE])
+AC_SUBST([VERSION_SCRIPT_FLAGS])
dnl Look for windres to build a Windows icon resource.
diff -u -r a/src/libvirt_private.syms b/src/libvirt_private.syms
--- a/src/libvirt_private.syms 2010-04-30 15:45:44 +0000
+++ b/src/libvirt_private.syms 2010-05-01 13:04:08 +0000
@@ -623,7 +623,6 @@
virCondInit;
virCondDestroy;
virCondWait;
-virCondWaitUntil;
virCondSignal;
virCondBroadcast;
@@ -667,7 +666,6 @@
virFileLinkPointsTo;
virParseNumber;
virParseVersionString;
-virPipeReadUntilEOF;
virAsprintf;
virRun;
virSkipSpaces;
diff -u -r a/src/util/dnsmasq.c b/src/util/dnsmasq.c
--- a/src/util/dnsmasq.c 2010-04-26 15:20:26 +0000
+++ b/src/util/dnsmasq.c 2010-05-01 12:08:22 +0000
@@ -80,17 +80,17 @@
const char *name)
{
if (VIR_REALLOC_N(hostsfile->hosts, hostsfile->nhosts + 1) < 0)
- goto alloc_error;
+ goto no_memory;
if (name) {
if (virAsprintf(&hostsfile->hosts[hostsfile->nhosts].host, "%s,%s,%s",
- mac, ip, name) < 0) {
- goto alloc_error;
+ mac, ip, name) < 0) {
+ goto no_memory;
}
} else {
if (virAsprintf(&hostsfile->hosts[hostsfile->nhosts].host, "%s,%s",
- mac, ip) < 0) {
- goto alloc_error;
+ mac, ip) < 0) {
+ goto no_memory;
}
}
@@ -98,10 +98,9 @@
return 0;
- alloc_error:
- virReportSystemError(ENOMEM,
- _("Failed to add dhcp host entry: mac=%s, ip=%s, name=%s\n"),
- mac, ip, (name ? name : "(null)"));
+ no_memory:
+ virReportOOMError();
+
return -1;
}
@@ -112,20 +111,23 @@
int err;
dnsmasqHostsfile *hostsfile;
- if (VIR_ALLOC(hostsfile) < 0)
+ if (VIR_ALLOC(hostsfile) < 0) {
+ virReportOOMError();
return NULL;
+ }
hostsfile->hosts = NULL;
hostsfile->nhosts = 0;
if (virAsprintf(&hostsfile->path, "%s/%s.%s", config_dir, name,
- DNSMASQ_HOSTSFILE_SUFFIX) < 0) {
+ DNSMASQ_HOSTSFILE_SUFFIX) < 0) {
+ virReportOOMError();
goto error;
}
if ((err = virFileMakePath(config_dir))) {
virReportSystemError(err, _("cannot create config directory '%s'"),
- config_dir);
+ config_dir);
goto error;
}
@@ -201,11 +203,11 @@
hostsfileSave(dnsmasqHostsfile *hostsfile)
{
int err = hostsfileWrite(hostsfile->path, hostsfile->hosts,
- hostsfile->nhosts);
+ hostsfile->nhosts);
if (err < 0) {
virReportSystemError(err, _("cannot write config file '%s'"),
- hostsfile->path);
+ hostsfile->path);
return -1;
}
@@ -220,7 +222,7 @@
if (unlink(hostsfile->path) < 0) {
virReportSystemError(errno, _("cannot remove config file '%s'"),
- hostsfile->path);
+ hostsfile->path);
return -1;
}
@@ -240,8 +242,10 @@
{
dnsmasqContext *ctx;
- if (VIR_ALLOC(ctx) < 0)
+ if (VIR_ALLOC(ctx) < 0) {
+ virReportOOMError();
return NULL;
+ }
if (!(ctx->hostsfile = hostsfileNew(network_name, config_dir)))
goto error;
@@ -328,14 +332,16 @@
* Reloads all the configurations associated to a context
*/
int
-dnsmasqReload(pid_t pid)
+dnsmasqReload(pid_t pid ATTRIBUTE_UNUSED)
{
+#ifndef WIN32
if (kill(pid, SIGHUP) != 0) {
virReportSystemError(errno,
- _("Failed to make dnsmasq (PID: %d) reload config files.\n"),
+ _("Failed to make dnsmasq (PID: %d) reload config files"),
pid);
return -1;
}
+#endif
return 0;
}
Jump to Line
Something went wrong with that request. Please try again.