[RFC] new applets: i2c-tools

Bartosz Gołaszewski bartekgola at gmail.com
Wed Dec 10 10:20:48 UTC 2014


2014-12-09 18:09 GMT+01:00 walter harms <wharms at bfs.de>:
>
> could you please explain shortly why you have a external buffer here ?
>
> you could easly do
> filename=xasprintf("/dev/i2c-%d", i2cbus);
> or
> char filename[32];
> or

This is done to pass the filename to the calling function. It isn't
used by i2cget in this case, but possibly will be used by other utils
(it is in i2c-tools).

> btw:
> bb_perror_msg_and_die("Could not open file: "Could not open file: %s",filename) would work also ?

This would only show one of two possible filenames.

Bart


More information about the busybox mailing list