Re: A GnomeVFS API for accessing standard streams
- From: Michael Meeks <michael ximian com>
- To: Alex Larsson <alexl redhat com>
- Cc: Giovanni Corriga <valkadesh libero it>, gnome-vfs-list gnome org, Release Team <release-team gnome org>
- Subject: Re: A GnomeVFS API for accessing standard streams
- Date: 03 Dec 2002 09:26:15 +0000
Hi Release team guys,
We have this 'console:///' method committed in gnome-vfs - the API for
which is somewhat sub-optimal; we'd like to replace it with Giovanni's
patch - providing a far more useful, supportable and flexible approach.
Oh - and of course, since no-one actually uses it yet, it's going to
have ~0 impact on the main codebase.
It also adds but 1 API method.
Can we go ahead ?
Regards,
Michael.
On Mon, 2002-12-02 at 09:21, Alexander Larsson wrote:
> On 29 Nov 2002, Giovanni Corriga wrote:
>
> > Ok, I have modified the code taking into account what Alex said.
> > I've attached the new code to bug #99796:
> >
> > http://bugzilla.gnome.org/show_bug.cgi?id=99796
> >
>
> +/* Convert a file descriptor to a handle */
> +GnomeVFSResult gnome_vfs_open_fd (GnomeVFSHandle **handle,
> + gint filedes,
> + GnomeVFSOpenMode open_mode);
>
> Drop the open_mode part. It should be extracted from the fd using
> fcntl(fd, F_GETFL, &args).
>
> #ifdef HAVE_LSEEK64
> #define LSEEK lseek64
> #define OFF_T off64_t
> #else
> #define LSEEK lseek
> #define OFF_T off_t
> #endif
>
> That should not be necesary, since gnome-vfs builds with
> _FILE_OFFSET_BITS=64. Just use lseek and off_t.
>
> Things like:
> do
> close_retval = close (file_handle->fd);
> while (close_retval != 0
> && errno == EINTR
> && ! gnome_vfs_context_check_cancellation (context));
>
> Should use braces:
> do {
> foo;
> } while (...);
>
>
> In do_get_file_info_from_handle():
>
> if (options & GNOME_VFS_FILE_INFO_GET_MIME_TYPE)
> {
> file_info->mime_type = g_strdup ("x-special/device-char");
> file_info->valid_fields |= GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE;
> }
>
> That's wrong in general for any random filedescriptor, and the
> indentation is wrong.
>
> open_fd():
>
> file_handle = file_handle_new(uri, filedes);
> *handle = gnome_vfs_handle_new(uri, (GnomeVFSMethodHandle*)file_handle, open_mode);
>
> Need space before the parenthesis.
>
> Otherwise this looks good to me, and I'd really like it to go in so we can
> remove the console method.
--
mmeeks gnu org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]