X-Git-Url: http://git.vrable.net/?p=bluesky.git;a=blobdiff_plain;f=logbench%2Flogbench.c;fp=logbench%2Flogbench.c;h=c421be1f5c1420e9258940896c0fc4650a9e617a;hp=6f3a858d223a1c208ba2b8afce60d0137e4157a3;hb=a0cdddf316f4119f31ca4939a7e0ba8d4ceb38e2;hpb=2b939f6cfc203a821a190ffd8a42c610ad991505 diff --git a/logbench/logbench.c b/logbench/logbench.c index 6f3a858..c421be1 100644 --- a/logbench/logbench.c +++ b/logbench/logbench.c @@ -84,14 +84,14 @@ void writebuf(int fd, const char *buf, size_t len) } /************************ 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); @@ -99,7 +99,7 @@ gpointer fslog_thread(gpointer d) finish_item(item); fsync(fd); - fsync(dirfd); + fsync(dir_fd); close(fd); } @@ -108,8 +108,8 @@ gpointer fslog_thread(gpointer d) 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);