[BusyBox] patch: libbb/or_die.c

Vladimir N. Oleynik dzo at simtreas.ru
Sun Mar 18 17:21:53 UTC 2001


Evin,
 
> >> Fairly often the busybox source has things like:
> >>
> >> fd = open("some file", O_RDONLY);
> >> if(fd < 0)
> >>     perror_msg_and_die("open some file");
> >> if(ioctl(fd, IOSOMECTL, &var)) < 0)
> >>     perror_msg_and_die("ioctl IOSOMECTL");
> >>
> >> Here's a patch which converts this to:
> >>
> >> fd = open_or_die("some file", O_RDONLY);
> >
> > I think, this interesting idea.
> 
> Would xopen be a more busyboxish name for it (given xmalloc, xstrdup,
> etc.)?

I see linux source sh-utils*/lib/x*
Very many x* functions.
I see usage in busybox for example getcdw(...) Brrr. Bad, very bad.
I think, require get full this kit.
 
> When I made the change, I thought displaying DEVPS_GET_PID_LIST was a
> typo in ps.c since it gives false information about the problem to the
> user.
> 
> When 'ps' fails, it's obvious that the problem is being unable to get
> the pid list -- you want to know what specific ioctl or /proc entry
> couldn't be read.

Oops. My fault.
In ps.c you patch is right.
But all changes not best.


--w
vodz





More information about the busybox mailing list