X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fswap.c;h=c2fe13aee60b5c815bb80ecc68ad314cb6e14262;hb=1e35941f62bddafd6b88270b22b3afe4a5d37baa;hp=99fb5639d83aa3e9bb41c074bf64118f3c3b9213;hpb=f5096dd546ac43c7288b3ab7aec1562f070f78f6;p=libguestfs.git diff --git a/daemon/swap.c b/daemon/swap.c index 99fb563..c2fe13a 100644 --- a/daemon/swap.c +++ b/daemon/swap.c @@ -43,8 +43,13 @@ optgroup_linuxfsuuid_available (void) char *err; int av; - /* Ignore return code - mkswap --help *will* fail. */ - ignore_value (command (NULL, &err, "mkswap", "--help", NULL)); + /* Upstream util-linux have been gradually changing '--help' to go + * from stderr to stdout, and changing the return code from 1 to 0. + * Thus we need to fold stdout and stderr together, and ignore the + * return code. + */ + ignore_value (commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR, + "mkswap", "--help", NULL)); av = strstr (err, "-U") != NULL; free (err);