]> git.tuebingen.mpg.de Git - paraslash.git/commit
afs: Pass sideband error packet on callback failures.
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 4 Apr 2015 23:20:00 +0000 (23:20 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 12 Aug 2015 21:23:47 +0000 (23:23 +0200)
commit586e2d24be69bc0aca8ad6c2033a4f4d193f5372
tree7b8adec1aab812a39c4225189e9c878bdbb95916
parent050003ccbd8b314038352f55d9fae53245670e78
afs: Pass sideband error packet on callback failures.

This changes the afs callback mechanism to honor negative return
values from a callback. We now send a special "callback failure"
sideband packet to the command handler in this case. This packet
contains the (negative) return value of the callback.

The dispatcher for afs callback results reads the error code and passes
it back via the callback request functions to the caller of the command
handler in handle_connect(). The latter already does the right thing:
It translates the error code into a string and sends this string to
the client.

This commit changes the callback of the ls command to return negative
on errors. With the patch applied the command

para_client ls /does/not/exist

now exits with status 1.

Other afs commands will make use of the new feature in subsequent
commits.
afs.c
aft.c
error.h
sideband.h