swaplabel: check writing to a file descriptor was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2013-04-13 20:54:57 +01:00 committed by Karel Zak
parent 833b7e0d80
commit de2ca55931
1 changed files with 4 additions and 1 deletions

View File

@ -145,7 +145,10 @@ static int change_info(const char *devname, const char *label, const char *uuid)
}
}
close(fd);
if (close_fd(fd) != 0) {
warn(_("write failed: %s"), devname);
return -1;
}
return 0;
err:
if (fd >= 0)