mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-25 21:24:16 +08:00
Fix dead assignment in write_key
This commit is contained in:
parent
e9119eb439
commit
995e8b35f4
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user