_lseek missing return type

Message ID 000a01d3a181$a3d5b060$eb811120$@jasoon.nl
State New
Headers show
Series
  • _lseek missing return type
Related show

Commit Message

Jaap de Wolff Feb. 9, 2018, 8:40 a.m.
In syscalls _lseek was missing a return type

Jaap de Wolff

Comments

Corinna Vinschen Feb. 9, 2018, 5:30 p.m. | #1
On Feb  9 09:40, Jaap de Wolff wrote:
> In syscalls _lseek was missing a return type

> 

> Jaap de Wolff

> 

> diff --git a/libgloss/arm/syscalls.c b/libgloss/arm/syscalls.c

> index 8163c7983..5548dcfb3 100644

> --- a/libgloss/arm/syscalls.c

> +++ b/libgloss/arm/syscalls.c

> @@ -493,6 +493,7 @@ _swilseek (int fd,

>      return -1;

>  }

>  

> +int

>  _lseek (int fd,

>  	int ptr,

>  	int dir)

> 


I'm somewhat aghast at this.  lseek is supposed to return off_t and
the ptr parameter should be off_t as well.  Shouldn't this be fixed
the right way?


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
Jaap de Wolff Feb. 9, 2018, 6:06 p.m. | #2
> -----Oorspronkelijk bericht-----

> Van: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org]

> Namens Corinna Vinschen

> Verzonden: Friday, February 9, 2018 6:31 PM

> Aan: newlib@sourceware.org

> Onderwerp: Re: [PATCH] _lseek missing return type

> 

> On Feb  9 09:40, Jaap de Wolff wrote:

> > In syscalls _lseek was missing a return type

> >

> > Jaap de Wolff

> >

> > diff --git a/libgloss/arm/syscalls.c b/libgloss/arm/syscalls.c index

> > 8163c7983..5548dcfb3 100644

> > --- a/libgloss/arm/syscalls.c

> > +++ b/libgloss/arm/syscalls.c

> > @@ -493,6 +493,7 @@ _swilseek (int fd,

> >      return -1;

> >  }

> >

> > +int

> >  _lseek (int fd,

> >  	int ptr,

> >  	int dir)

> >

> 

> I'm somewhat aghast at this.  lseek is supposed to return off_t and the ptr

> parameter should be off_t as well.  Shouldn't this be fixed the right way?

> 

> 

> Thanks,

> Corinna

> 

> --

> Corinna Vinschen

> Cygwin Maintainer

> Red Hat


I was just following the definition which I did find in the same file, on line 40:
int     _lseek		(int, int, int);
However, I agree that we should do this the right way.

I will take all your comment into account, and after I have reviewed my own modifications based on your suggestions, I will sent all patches in the git format-patch format.

Jaap de Wolff

Patch

diff --git a/libgloss/arm/syscalls.c b/libgloss/arm/syscalls.c
index 8163c7983..5548dcfb3 100644
--- a/libgloss/arm/syscalls.c
+++ b/libgloss/arm/syscalls.c
@@ -493,6 +493,7 @@  _swilseek (int fd,
     return -1;
 }
 
+int
 _lseek (int fd,
 	int ptr,
 	int dir)