This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
The following commit(s) were added to refs/heads/master by this push:
new 8a0b4b2 gfs2_jadd: Fix static analysis warnings
8a0b4b2 is described below
commit 8a0b4b2183e05be4c92612b0a82ed64617e6a742
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Jun 9 15:24:28 2020 +0100
gfs2_jadd: Fix static analysis warnings
Fix these warnings:
gfs2/mkfs/main_jadd.c:264:8: warning: Although the value stored to
'error' is used in the enclosing expression, the value is never actually
read from 'error'
gfs2/mkfs/main_jadd.c:514:15: warning: Assigned value is garbage or
undefined
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/mkfs/main_jadd.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
index ea89c96..03134a6 100644
--- a/gfs2/mkfs/main_jadd.c
+++ b/gfs2/mkfs/main_jadd.c
@@ -241,7 +241,7 @@ static void print_results(struct jadd_opts *opts)
static int create_new_inode(struct jadd_opts *opts, uint64_t *addr)
{
char *name = opts->new_inode;
- int fd, error = 0;
+ int fd;
for (;;) {
fd = open(name, O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW | O_CLOEXEC, 0600);
@@ -261,9 +261,10 @@ static int create_new_inode(struct jadd_opts *opts, uint64_t *addr)
if (addr != NULL) {
struct stat st;
- if ((error = fstat(fd, &st))) {
+ if (fstat(fd, &st) == -1) {
perror("fstat");
- return close(fd);
+ close(fd);
+ return -1;
}
*addr = st.st_ino;
}
@@ -481,7 +482,7 @@ static int add_j(struct gfs2_sbd *sdp, struct jadd_opts *opts)
unsigned int x, blocks =
sdp->jsize << (20 - sdp->sd_sb.sb_bsize_shift);
struct gfs2_log_header lh;
- uint64_t seq = RANDOM(blocks), addr;
+ uint64_t seq = RANDOM(blocks), addr = 0;
off_t off = 0;
if ((fd = create_new_inode(opts, &addr)) < 0)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date