summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-09-17 13:15:49 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-09-17 13:37:06 +0100
commite128a627fb8f39f4f4c11b782cef895bd79f0282 (patch)
tree4c75d040a7441f5019d41d3f05790ed009e1ae80 /daemon
parentc387b69cba8f145438188b2b4567abbc9580ade0 (diff)
downloadlibguestfs-e128a627fb8f39f4f4c11b782cef895bd79f0282.tar.gz
libguestfs-e128a627fb8f39f4f4c11b782cef895bd79f0282.tar.xz
libguestfs-e128a627fb8f39f4f4c11b782cef895bd79f0282.zip
Fix multiple errors where jump skips variable initialization.
<file>: error: jump skips variable initialization [-Werror=jump-misses-init] This has only just appeared, possibly related to previous gnulib update. In any case, this is just code motion / cleanup.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/luks.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/daemon/luks.c b/daemon/luks.c
index 3e3b4567..9ce8e2cf 100644
--- a/daemon/luks.c
+++ b/daemon/luks.c
@@ -40,19 +40,23 @@ optgroup_luks_available (void)
static char *
write_key_to_temp (const char *key)
{
- char *tempfile = strdup ("/tmp/luksXXXXXX");
+ char *tempfile;
+ int fd;
+ size_t len;
+
+ tempfile = strdup ("/tmp/luksXXXXXX");
if (!tempfile) {
reply_with_perror ("strdup");
return NULL;
}
- int fd = mkstemp (tempfile);
+ fd = mkstemp (tempfile);
if (fd == -1) {
reply_with_perror ("mkstemp");
goto error;
}
- size_t len = strlen (key);
+ len = strlen (key);
if (xwrite (fd, key, len) == -1) {
reply_with_perror ("write");
close (fd);