devgpio: make reading ctl file return 0 bytes
This commit is contained in:
parent
1290c534be
commit
dc72530159
1 changed files with 2 additions and 2 deletions
|
@ -448,6 +448,7 @@ gpioread(Chan *c, void *va, long n, vlong off)
|
|||
n = 1;
|
||||
break;
|
||||
case Qctl:
|
||||
n = 0;
|
||||
break;
|
||||
case Qevent:
|
||||
if(off >= 4)
|
||||
|
@ -555,10 +556,10 @@ gpiowrite(Chan *c, void *va, long n, vlong)
|
|||
break;
|
||||
case CMfunc:
|
||||
pin = getpin(cb->f[2]);
|
||||
arg = cb->f[1];
|
||||
if(pin == -1) {
|
||||
error(Ebadctl);
|
||||
}
|
||||
arg = cb->f[1];
|
||||
for(i = 0; i < nelem(funcname); i++)
|
||||
{
|
||||
if(strncmp(funcname[i], arg, strlen(funcname[i])) == 0)
|
||||
|
@ -588,7 +589,6 @@ gpiowrite(Chan *c, void *va, long n, vlong)
|
|||
if(pin == -1) {
|
||||
error(Ebadctl);
|
||||
}
|
||||
|
||||
arg = cb->f[1];
|
||||
for(i = 0; i < nelem(evtypename); i++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue