Commit 72792689 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Remove unlock

Locks will be released on close.
parent cc393524
......@@ -667,7 +667,6 @@ zathura_db_read_key_file_from_file(const char* path)
/* read config file */
file_lock_set(fileno(file), F_WRLCK);
char* content = girara_file_read2(file);
file_lock_set(fileno(file), F_UNLCK);
fclose(file);
if (content == NULL) {
g_key_file_free(key_file);
......@@ -733,8 +732,6 @@ zathura_db_write_key_file_to_file(const char* file, GKeyFile* key_file)
if (write(fd, content, strlen(content)) == 0) {
girara_error("Failed to write to %s", file);
}
file_lock_set(fd, F_UNLCK);
close(fd);
g_free(content);
......@@ -787,7 +784,6 @@ plain_io_read(GiraraInputHistoryIO* db)
/* read input history file */
file_lock_set(fileno(file), F_RDLCK);
char* content = girara_file_read2(file);
file_lock_set(fileno(file), F_UNLCK);
fclose(file);
girara_list_t* res = girara_list_new2(g_free);
......@@ -823,7 +819,6 @@ plain_io_append(GiraraInputHistoryIO* db, const char* input)
rewind(file);
if (ftruncate(fileno(file), 0) != 0) {
free(content);
file_lock_set(fileno(file), F_UNLCK);
fclose(file);
return;
}
......@@ -840,8 +835,6 @@ plain_io_append(GiraraInputHistoryIO* db, const char* input)
}
g_strfreev(tmp);
fprintf(file, "%s\n", input);
file_lock_set(fileno(file), F_UNLCK);
fclose(file);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment