[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Git][glibc-team/glibc][sid] libc.preinst: Avoid using pidof



Hi,

On 2022-09-22 17:18, Stepan Golosunov wrote:
> > Aurelien Jarno pushed to branch sid at GNU Libc Maintainers / glibc
> > Commits:
> 
> >    309ee6f5
> >    by Gioele Barabucci at 2022-09-21T21:54:06+00:00
> >    libc.preinst: Avoid using pidof
> 
> > -            if pidof xscreensaver xlockmore >/dev/null; then
> > +            if grep -E -q -z '/(xscreensaver|xlockmore)' /proc/*/cmdline 2>/dev/null; then
> 
> Looks like new version doesn't work:
> 
> % pidof xscreensaver xlockmore;echo $?
> 10798 4240
> 0
> % grep -E -q -z '/(xscreensaver|xlockmore)' /proc/*/cmdline;echo $?
> 1
> % hd /proc/10798/cmdline
> 00000000  78 73 63 72 65 65 6e 73  61 76 65 72 00 2d 6e 6f  |xscreensaver.-no|
> 00000010  2d 73 70 6c 61 73 68 00                           |-splash.|
> 00000018
> % hd /proc/4240/cmdline
> 00000000  78 73 63 72 65 65 6e 73  61 76 65 72 00           |xscreensaver.|
> 0000000d

Indeed that does not work when xscreensaver is launched using the PATH.
I have just pushed a fix updating the regex to also handle that case.

Thanks,
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net


Reply to: