[ovs-dev] [PATCH 08/15] process: Remove pointless, redundant assignments from stream_read().

Ben Pfaff blp at nicira.com
Wed Feb 10 11:30:31 PST 2010


Found by Clang (http://clang-analyzer.llvm.org/).
---
 lib/process.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/process.c b/lib/process.c
index 3f66ddd..3504dfb 100644
--- a/lib/process.c
+++ b/lib/process.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -415,15 +415,13 @@ stream_open(struct stream *s)
 static void
 stream_read(struct stream *s)
 {
-    int error = 0;
-
     if (s->fds[0] < 0) {
         return;
     }
 
-    error = 0;
     for (;;) {
         char buffer[512];
+        int error;
         size_t n;
 
         error = read_fully(s->fds[0], buffer, sizeof buffer, &n);
-- 
1.6.6.1





More information about the dev mailing list