From: Marc Dionne Date: Sat, 11 Sep 2010 14:46:50 +0000 (-0400) Subject: Always check return code from iod_Write X-Git-Tag: openafs-devel-1_5_78~147 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e18a8f62065ffa7b2ca49d7b4baabd7d7ba92555;p=packages%2Fo%2Fopenafs.git Always check return code from iod_Write The return code from iod_Write is checked at every call site in the file, except this one. Check it, and return VOLSERDUMPERROR if appropriate. Spotted by a set but unused warning from gcc 4.6 Change-Id: I84f38a4b3b1e37c25be9c76702b0d2818058454e Reviewed-on: http://gerrit.openafs.org/2733 Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit e0708617b8f5df625b6ad62920665e704f1374f7) Reviewed-on: http://gerrit.openafs.org/2795 --- diff --git a/src/volser/dumpstuff.c b/src/volser/dumpstuff.c index 0b06feb43..1ec359c0f 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -664,6 +664,8 @@ DumpStandardTag(struct iod *iodp, char tag, afs_uint32 section) return VOLSERDUMPERROR; } code = iod_Write(iodp, &tag, 1); + if (code != 1) + return VOLSERDUMPERROR; return 0; }