Unreviewed. Fix GTK+ build after r210571.
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jan 2017 08:52:56 +0000 (08:52 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jan 2017 08:52:56 +0000 (08:52 +0000)
Add getFileDeviceId implementation to FileSystemGlib.cpp.

* platform/glib/FileSystemGlib.cpp:
(WebCore::getFileDeviceId):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210580 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/glib/FileSystemGlib.cpp

index 77492ed..b3ff0f5 100644 (file)
@@ -1,3 +1,12 @@
+2017-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Unreviewed. Fix GTK+ build after r210571.
+
+        Add getFileDeviceId implementation to FileSystemGlib.cpp.
+
+        * platform/glib/FileSystemGlib.cpp:
+        (WebCore::getFileDeviceId):
+
 2017-01-11  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Unreviewed GTK buildfix after r210571.
index dffd86b..c2e7703 100644 (file)
@@ -408,4 +408,16 @@ bool hardLinkOrCopyFile(const String& source, const String& destination)
 #endif
 }
 
+std::optional<int32_t> getFileDeviceId(PlatformFileHandle handle)
+{
+    if (!isHandleValid(handle))
+        return std::nullopt;
+
+    GRefPtr<GFileInfo> fileInfo = adoptGRef(g_file_io_stream_query_info(handle, G_FILE_ATTRIBUTE_UNIX_DEVICE, nullptr, nullptr));
+    if (!fileInfo)
+        return std::nullopt;
+
+    return g_file_info_get_attribute_uint32(fileInfo.get(), G_FILE_ATTRIBUTE_UNIX_DEVICE);
+}
+
 }