[Pkg-libvirt-commits] [libguestfs] 42/266: make-fs: use CLEANUP_FCLOSE
Hilko Bengen
bengen at moszumanska.debian.org
Fri Oct 3 14:41:39 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag debian/1%1.27.35-1
in repository libguestfs.
commit 9c3ce6535c34da761148204d5efe014598b1c0a1
Author: Pino Toscano <ptoscano at redhat.com>
Date: Fri Jul 25 17:36:16 2014 +0200
make-fs: use CLEANUP_FCLOSE
---
make-fs/make-fs.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/make-fs/make-fs.c b/make-fs/make-fs.c
index a03bb8f..1bec3e2 100644
--- a/make-fs/make-fs.c
+++ b/make-fs/make-fs.c
@@ -378,7 +378,7 @@ estimate_input (const char *input, uint64_t *estimate_rtn, char **ifmt_rtn)
struct stat statbuf;
const char *argv[6];
CLEANUP_UNLINK_FREE char *tmpfile = NULL;
- FILE *fp;
+ CLEANUP_FCLOSE FILE *fp = NULL;
char line[256];
size_t len;
@@ -419,10 +419,8 @@ estimate_input (const char *input, uint64_t *estimate_rtn, char **ifmt_rtn)
}
if (fgets (line, sizeof line, fp) == NULL) {
perror ("fgets");
- fclose (fp);
return -1;
}
- fclose (fp);
if (sscanf (line, "%" SCNu64, estimate_rtn) != 1) {
fprintf (stderr, _("%s: cannot parse the output of 'du' command: %s\n"),
@@ -448,7 +446,6 @@ estimate_input (const char *input, uint64_t *estimate_rtn, char **ifmt_rtn)
perror ("fgets");
return -1;
}
- fclose (fp);
len = strlen (line);
if (len > 0 && line[len-1] == '\n')
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list