viced: CopyOnWrite2 shouldn't return undefined val
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Sat, 12 Jun 2010 09:26:09 +0000 (10:26 +0100)
committerDerrick Brashear <shadow@dementia.org>
Sun, 13 Jun 2010 05:40:56 +0000 (22:40 -0700)
commit6dd07af215e2cc75cb7c902b5a06920a5ee5235c
tree799d9e964fad0828ad12497b9e3a12e6370b455f
parent0deaa4d58cdd0af2b402e06df1edd0cf4d49074c
viced: CopyOnWrite2 shouldn't return undefined val

Unless CopyOnWrite2 encounters the condition where
(rdlen != length) || (wrlen !=length) it will never set a value
for the 'rc' return code, and so return with an undefined value.

Looking at the code, it looks like rc should be 0 in all other
situations, so this patch provides a default value.

Caught by clang-analyzer

Change-Id: If3e528f3d66abb3dde6da2304084f7698c05b863
Reviewed-on: http://gerrit.openafs.org/2141
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/viced/afsfileprocs.c