[ksh93-integration-discuss] Toy/prototype patch top add "shcomp"+ "shbinexec" kernel module...

Roland Mainz roland.mainz at nrubsig.org
Wed Sep 6 22:29:38 PDT 2006


"I. Szczesniak" wrote:
> On 9/6/06, Roland Mainz <roland.mainz at nrubsig.org> wrote:
> > +static int
> > +getshbinhead(struct vnode *vp, struct intpdata *idatap)
> > +{
> > +       int error;
> > +       char *cp, *linep = idatap->intp;
> > +       ssize_t resid;
> > +
> > +       /*
> > +        * Read the entire line and confirm that it starts with '#!'.
> > +        */
> > +       if (error = vn_rdwr(UIO_READ, vp, linep, INTPSZ, (offset_t)0,
> > +           UIO_SYSSPACE, 0, (rlim64_t)0, CRED(), &resid))
> > +               return (error);
> > +
> > +       if (!memcmp(linep, shbinmagicstr, SHBINMAGIC_LEN))
> > +               return (ENOEXEC);
> 
> I think the logic needs to be reversed. The memcmp function returns 0
> for an equal match and in this case your code returns ENOEXEC.

Thanks! ... :-)
... that mistake was just... dumb (which usually happens when I still
try to do something usefull at 4:00am or later) ... ;-(

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)



More information about the ksh93-integration-discuss mailing list