Re: [PATCH] Make kill-dhclient.sh more readable

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

 



On Fri, 2009-06-05 at 13:06 +0200, Harald Hoyer wrote:
> On 06/05/2009 11:45 AM, Seewer Philippe wrote:
> > Checking for existing file is more readable than string comparison
> >
> > ---
> > diff --git a/modules.d/40network/kill-dhclient.sh
> > b/modules.d/40network/kill-dhclient.sh
> > index 19f258a..fcebd32 100755
> > --- a/modules.d/40network/kill-dhclient.sh
> > +++ b/modules.d/40network/kill-dhclient.sh
> > @@ -1,5 +1,5 @@
> > #!/bin/sh
> >
> > for f in /tmp/dhclient.*.pid; do
> > - [ "$f" != "/tmp/dhclient.*.pid" ] && kill $(cat $f)
> > + [ -e $f ] && kill $(cat $f)
> > done
> 
> but it involves a disk access :)
> for the sake of speed :) (not that it matters much here.. )

To a ram disk. :)
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux