From 8b75c8e341279032e34a1d496b2181362db3e6b8 Mon Sep 17 00:00:00 2001 From: Colin Walters <walters@verbum.org> Date: Tue, 11 Jul 2017 10:30:05 -0400 Subject: [PATCH] Remove glnx_stream_fstat() There are only two users of this in ostree, and one of them is fairly bogus; we can just use `fstat()`. --- glnx-fdio.c | 25 ------------------------- glnx-fdio.h | 5 ----- 2 files changed, 30 deletions(-) diff --git a/glnx-fdio.c b/glnx-fdio.c index ffe5400d1..797d939c2 100644 --- a/glnx-fdio.c +++ b/glnx-fdio.c @@ -1022,28 +1022,3 @@ glnx_file_replace_contents_with_perms_at (int dfd, return TRUE; } - -/** - * glnx_stream_fstat: - * @stream: A stream containing a Unix file descriptor - * @stbuf: Memory location to write stat buffer - * @error: - * - * Some streams created via libgsystem are #GUnixInputStream; these do - * not support e.g. g_file_input_stream_query_info(). This function - * allows dropping to the raw unix fstat() call for these types of - * streams, while still conveniently wrapped with the normal GLib - * handling of @error. - */ -gboolean -glnx_stream_fstat (GFileDescriptorBased *stream, - struct stat *stbuf, - GError **error) -{ - int fd = g_file_descriptor_based_get_fd (stream); - - if (fstat (fd, stbuf) == -1) - return glnx_throw_errno_prefix (error, "fstat"); - - return TRUE; -} diff --git a/glnx-fdio.h b/glnx-fdio.h index 150b22e3e..601e7936d 100644 --- a/glnx-fdio.h +++ b/glnx-fdio.h @@ -181,11 +181,6 @@ glnx_file_copy_at (int src_dfd, GCancellable *cancellable, GError **error); -gboolean -glnx_stream_fstat (GFileDescriptorBased *stream, - struct stat *stbuf, - GError **error); - int glnx_renameat2_noreplace (int olddirfd, const char *oldpath, int newdirfd, const char *newpath); int glnx_renameat2_exchange (int olddirfd, const char *oldpath, -- GitLab