hush/miscutils
Bartosz Golaszewski 7ca5c51cc8 i2c-tools: only try /dev/i2c/* if opening /dev/i2c-* fails with ENOENT
Trying to access /dev/i2c/* on every error after opening /dev/i2c-* can
mislead users who e.g. don't have root access. Instead of bailing-out
with "permission denied" we currently print "no such file or directory".

Fix it by trying open("/dev/i2c/%d") only if we got ENOENT.

Upstream i2cdetect tries to get any info it can from /sys and /proc even
when invoked by an unprivileged user, but we don't want to add unnecessary
bloat.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-05-11 17:26:27 +02:00
..
adjtimex.c
bbconfig.c
beep.c *: remove "Options:" string from help texts 2011-06-05 03:58:28 +02:00
chat.c
chrt.c
Config.src
conspy.c
crond.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00
crontab.c
dc.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00
devfsd.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00
devmem.c
eject.c
fbsplash.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00
fbsplash.cfg
flash_eraseall.c
flash_lock_unlock.c
flashcp.c
hdparm.c
i2c_tools.c i2c-tools: only try /dev/i2c/* if opening /dev/i2c-* fails with ENOENT 2015-05-11 17:26:27 +02:00
inotifyd.c
ionice.c
Kbuild.src
last_fancy.c *: Switch to POSIX utmpx API 2015-04-02 23:03:46 +02:00
last.c *: Switch to POSIX utmpx API 2015-04-02 23:03:46 +02:00
less.c
makedevs.c
man.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00
microcom.c
mountpoint.c
mt.c
nandwrite.c
raidautorun.c
readahead.c
rfkill.c
runlevel.c *: Switch to POSIX utmpx API 2015-04-02 23:03:46 +02:00
rx.c
setserial.c
setsid.c
strings.c
taskset.c
time.c
timeout.c
ttysize.c
ubi_tools.c ubiattach: add option -O 2015-01-30 18:33:24 +01:00
volname.c
wall.c *: Switch to POSIX utmpx API 2015-04-02 23:03:46 +02:00
watchdog.c