From: Ben Pfaff Date: Wed, 10 Feb 2010 18:57:14 +0000 (-0800) Subject: process: Remove pointless, redundant assignments from stream_read(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=651471fda8df6b3190973a2f048b66448fe90a93;p=openvswitch process: Remove pointless, redundant assignments from stream_read(). Found by Clang (http://clang-analyzer.llvm.org/). --- diff --git a/lib/process.c b/lib/process.c index 3f66ddd9..3504dfb0 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);