]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Always check return code from iod_Write
authorMarc Dionne <marc.c.dionne@gmail.com>
Sat, 11 Sep 2010 14:46:50 +0000 (10:46 -0400)
committerDerrick Brashear <shadow@dementia.org>
Mon, 27 Sep 2010 15:27:09 +0000 (08:27 -0700)
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 <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e0708617b8f5df625b6ad62920665e704f1374f7)
Reviewed-on: http://gerrit.openafs.org/2795

src/volser/dumpstuff.c

index 0b06feb434049f2a6ecc6708b3abaaa908f3f4a9..1ec359c0f2ab041e3021f6ccf03f8dc3112c8305 100644 (file)
@@ -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;
 }