Fix BlueSky build on modern Linux and libs3.
[bluesky.git] / logbench / logbench.c
index 6f3a858..c421be1 100644 (file)
@@ -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);