From: Richard Jones Date: Thu, 6 Aug 2009 17:46:57 +0000 (+0100) Subject: Always pass mkswap -f parameter. X-Git-Tag: 1.0.67~61 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=530a90d3d4d7d107f52ac8db90fdb86c4f3e1737;p=libguestfs.git Always pass mkswap -f parameter. Otherwise mkswap will give a silly error if you ask it to swap on a whole device. --- diff --git a/daemon/swap.c b/daemon/swap.c index db93e57..3ebdef6 100644 --- a/daemon/swap.c +++ b/daemon/swap.c @@ -34,9 +34,9 @@ mkswap (char *device, const char *flag, const char *value) int r; if (!flag) - r = command (NULL, &err, "/sbin/mkswap", device, NULL); + r = command (NULL, &err, "/sbin/mkswap", "-f", device, NULL); else - r = command (NULL, &err, "/sbin/mkswap", flag, value, device, NULL); + r = command (NULL, &err, "/sbin/mkswap", "-f", flag, value, device, NULL); if (r == -1) { reply_with_error ("mkswap: %s", err);