]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
swaplabel: check writing to a file descriptor was successful
authorSami Kerola <kerolasa@iki.fi>
Sat, 13 Apr 2013 19:54:57 +0000 (20:54 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 26 Apr 2013 11:26:07 +0000 (13:26 +0200)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
disk-utils/swaplabel.c

index 3e3e78b16eaa72d00e617a9d24d621a39c463574..a5ccb7ec389caaedbf7e2ce794fc7b05653aae3c 100644 (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)