From: Simon Wilkinson Date: Tue, 15 Jun 2010 17:15:34 +0000 (+0100) Subject: viced.c: Don't store results of reads unecessarily X-Git-Tag: upstream/1.8.0_pre1^2~3491 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ba18ea65174dd06a305e3524756aaca6ebb04e9a;p=packages%2Fo%2Fopenafs.git viced.c: Don't store results of reads unecessarily When we don't need to store the amount of data read from a file, don't complicate the if() statement by adding a pointless assignment. Caught by clang-analyzer Change-Id: I326d894c9b5f7a89f31534c7864e05ea059a03aa Reviewed-on: http://gerrit.openafs.org/5079 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- diff --git a/src/viced/viced.c b/src/viced/viced.c index bfcb629b1..cb1d42641 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -1654,7 +1654,7 @@ ReadSysIdFile(void) errno)); return EIO; } - if ((i = read(fd, (char *)&vsn, sizeof(vsn))) != sizeof(vsn)) { + if (read(fd, (char *)&vsn, sizeof(vsn)) != sizeof(vsn)) { ViceLog(0, ("%s: Read failed (%d)\n", AFSDIR_SERVER_SYSID_FILEPATH, errno)); @@ -1672,9 +1672,8 @@ ReadSysIdFile(void) AFSDIR_SERVER_SYSID_FILEPATH, vsn.version, SYSIDVERSION)); return EIO; } - if ((i = - read(fd, (char *)&uuid, - sizeof(struct afsUUID))) != sizeof(struct afsUUID)) { + if (read(fd, (char *)&uuid, sizeof(struct afsUUID)) + != sizeof(struct afsUUID)) { ViceLog(0, ("%s: read of uuid failed (%d)\n", AFSDIR_SERVER_SYSID_FILEPATH, errno)); @@ -1682,9 +1681,7 @@ ReadSysIdFile(void) } afs_ntohuuid(&uuid); FS_HostUUID = uuid; - if ((i = - read(fd, (char *)&nentries, - sizeof(afs_int32))) != sizeof(afs_int32)) { + if (read(fd, (char *)&nentries, sizeof(afs_int32)) != sizeof(afs_int32)) { ViceLog(0, ("%s: Read of entries failed (%d)\n", AFSDIR_SERVER_SYSID_FILEPATH, errno));