Fix dead assignment in write_key

This commit is contained in:
Szymon Janc 2011-05-10 11:24:12 +02:00 committed by Johan Hedberg
parent e9119eb439
commit 995e8b35f4

View File

@ -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);