}
/************************ Direct-to-filesystem logging ***********************/
-static int dirfd = -1;
+static int dir_fd = -1;
gpointer fslog_thread(gpointer d)
{
while (TRUE) {
struct item *item = get_item();
- int fd = openat(dirfd, item->key, O_CREAT|O_WRONLY|O_TRUNC, 0666);
+ int fd = openat(dir_fd, item->key, O_CREAT|O_WRONLY|O_TRUNC, 0666);
g_assert(fd >= 0);
writebuf(fd, item->data, item->len);
finish_item(item);
fsync(fd);
- fsync(dirfd);
+ fsync(dir_fd);
close(fd);
}
void launch_fslog()
{
- dirfd = open(".", O_DIRECTORY);
- g_assert(dirfd >= 0);
+ dir_fd = open(".", O_DIRECTORY);
+ g_assert(dir_fd >= 0);
for (int i = 0; i < 1; i++)
g_thread_create(fslog_thread, NULL, FALSE, NULL);