Strange echo behaviour

Baruch Siach baruch at tkos.co.il
Wed Jan 26 12:21:17 UTC 2011


Hi busybox list,

I'm running the following command under strace (thanks Rob):

echo 56 > /sys/class/gpio/export

and I see the following output:

write(1, "56\n", 3)                     = -1 EBUSY (Device or resource busy)
write(1, "5", 1)                        = 1

The first EBUSY is OK, since GPIO 56 is already requested. But the second 
write() attempt seems strange, and leads to an unwanted outcome. GPIO 5 gets 
exported.

Looking into the code it seems like the fflush() call at the end for 
echo_main() is somehow responsible for this, but this is only a guess.

I have FEATURE_FANCY_ECHO enabled, FWIW.

Any suggestion?

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -


More information about the busybox mailing list