Re: touch(1): don't leak descriptor if futimens(2) fails

2022-01-28 Thread Philip Guenther
On Fri, Jan 28, 2022 at 7:37 AM Scott Cheloha wrote: > On Fri, Jan 28, 2022 at 07:28:40AM -0700, Todd C. Miller wrote: > > On Thu, 27 Jan 2022 20:02:18 -0800, Philip Guenther wrote: > > > > > > I think futimens(2) and close(2) failures are exotic enough to > warrant > > > > printing the system

Re: touch(1): don't leak descriptor if futimens(2) fails

2022-01-28 Thread Todd C . Miller
On Fri, 28 Jan 2022 09:37:33 -0600, Scott Cheloha wrote: > Alright, you have both convinced me. > > We'll go with this patch? Sure. OK millert@ - todd

Re: touch(1): don't leak descriptor if futimens(2) fails

2022-01-28 Thread Scott Cheloha
On Fri, Jan 28, 2022 at 07:28:40AM -0700, Todd C. Miller wrote: > On Thu, 27 Jan 2022 20:02:18 -0800, Philip Guenther wrote: > > > > I think futimens(2) and close(2) failures are exotic enough to warrant > > > printing the system call name. > > > > I don't understand this. Can you give an

Re: touch(1): don't leak descriptor if futimens(2) fails

2022-01-28 Thread Todd C . Miller
On Thu, 27 Jan 2022 20:02:18 -0800, Philip Guenther wrote: > > I think futimens(2) and close(2) failures are exotic enough to warrant > > printing the system call name. > > > > I don't understand this. Can you give an example of an error message that > touch currently might emit where knowing

Re: touch(1): don't leak descriptor if futimens(2) fails

2022-01-27 Thread Philip Guenther
On Thu, Jan 27, 2022 at 4:03 PM Scott Cheloha wrote: > If futimens(2) fails here then close(2) is not called and we leak the > descriptor. > Good catch. I think futimens(2) and close(2) failures are exotic enough to warrant > printing the system call name. > I don't understand this. Can you

touch(1): don't leak descriptor if futimens(2) fails

2022-01-27 Thread Scott Cheloha
If futimens(2) fails here then close(2) is not called and we leak the descriptor. I think futimens(2) and close(2) failures are exotic enough to warrant printing the system call name. ok? Index: touch.c === RCS file: