From 995e8b35f4ea700ad76e81dc3f9a5d18f8c2ed09 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 10 May 2011 11:24:12 +0200 Subject: [PATCH] Fix dead assignment in write_key --- src/textfile.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/textfile.c b/src/textfile.c index d115ff6a0..089cce8b9 100644 --- a/src/textfile.c +++ b/src/textfile.c @@ -182,7 +182,7 @@ static int write_key(const char *pathname, const char *key, const char *value, i { struct stat st; char *map, *off, *end, *str; - off_t size, pos; size_t base; + off_t size; size_t base; int fd, len, err = 0; fd = open(pathname, O_RDWR); @@ -203,7 +203,7 @@ static int write_key(const char *pathname, const char *key, const char *value, i if (!size) { if (value) { - pos = lseek(fd, size, SEEK_SET); + lseek(fd, size, SEEK_SET); err = write_key_value(fd, key, value); } goto unlock; @@ -221,7 +221,7 @@ static int write_key(const char *pathname, const char *key, const char *value, i if (!off) { if (value) { munmap(map, size); - pos = lseek(fd, size, SEEK_SET); + lseek(fd, size, SEEK_SET); err = write_key_value(fd, key, value); } goto unlock; @@ -249,7 +249,7 @@ static int write_key(const char *pathname, const char *key, const char *value, i err = errno; goto unlock; } - pos = lseek(fd, base, SEEK_SET); + lseek(fd, base, SEEK_SET); if (value) err = write_key_value(fd, key, value); @@ -275,7 +275,7 @@ static int write_key(const char *pathname, const char *key, const char *value, i free(str); goto unlock; } - pos = lseek(fd, base, SEEK_SET); + lseek(fd, base, SEEK_SET); if (value) err = write_key_value(fd, key, value);