Re: [PATCH 1/4] perf cgroup: Avoid needless closing of unopened fd
From: Arnaldo Carvalho de Melo
Date: Mon Apr 20 2020 - 08:05:50 EST
Em Mon, Apr 20, 2020 at 10:48:47AM +0200, Jiri Olsa escreveu:
> On Fri, Apr 17, 2020 at 04:23:26PM +0300, Tommi Rantala wrote:
> > Do not bother with close() if fd is not valid, just to silence valgrind:
> >
> > $ valgrind ./perf script
> > ==59169== Memcheck, a memory error detector
> > ==59169== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
> > ==59169== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
> > ==59169== Command: ./perf script
> > ==59169==
> > ==59169== Warning: invalid file descriptor -1 in syscall close()
> > ==59169== Warning: invalid file descriptor -1 in syscall close()
> > ==59169== Warning: invalid file descriptor -1 in syscall close()
> > ==59169== Warning: invalid file descriptor -1 in syscall close()
> > ==59169== Warning: invalid file descriptor -1 in syscall close()
> > ==59169== Warning: invalid file descriptor -1 in syscall close()
> > ==59169== Warning: invalid file descriptor -1 in syscall close()
> > ==59169== Warning: invalid file descriptor -1 in syscall close()
> >
> > Signed-off-by: Tommi Rantala <tommi.t.rantala@xxxxxxxxx>
>
> Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Thanks, applied,
- Arnaldo