]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vos: Remove unused 'done' loop variable
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 19 Feb 2013 14:41:26 +0000 (14:41 +0000)
committerDerrick Brashear <shadow@your-file-system.com>
Thu, 21 Feb 2013 13:15:00 +0000 (05:15 -0800)
In SendFile we break at the same time as setting the done flag,
so its value is never checked. Just remove it as it is redundant
with the current loop logic.

Caught by clang-analyzer

Change-Id: Ibf8f756b06fd26cb2013ece97eb9196c71ad88bd
Reviewed-on: http://gerrit.openafs.org/9164
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
src/volser/vos.c

index cb807a0f3a86f87127133d49bd10b3d4866cdcd9..429fbce6f6992a8d8f88e77e74a52d938f90cef9 100644 (file)
@@ -280,7 +280,6 @@ SendFile(usd_handle_t ufd, struct rx_call *call, long blksize)
 {
     char *buffer = (char *)0;
     afs_int32 error = 0;
-    int done = 0;
     afs_uint32 nbytes;
 
     buffer = malloc(blksize);
@@ -289,7 +288,7 @@ SendFile(usd_handle_t ufd, struct rx_call *call, long blksize)
        return -1;
     }
 
-    while (!error && !done) {
+    while (!error) {
 #ifndef AFS_NT40_ENV           /* NT csn't select on non-socket fd's */
        fd_set in;
        FD_ZERO(&in);
@@ -307,10 +306,10 @@ SendFile(usd_handle_t ufd, struct rx_call *call, long blksize)
                    afs_error_message(error));
            break;
        }
-       if (nbytes == 0) {
-           done = 1;
+
+       if (nbytes == 0)
            break;
-       }
+
        if (rx_Write(call, buffer, nbytes) != nbytes) {
            error = -1;
            break;