summaryrefslogtreecommitdiff
path: root/src/io.c
diff options
context:
space:
mode:
authorCraig Silverstein <csilvers@khanacademy.org>2008-05-20 06:13:28 +0000
committerCraig Silverstein <csilvers@khanacademy.org>2008-05-20 06:13:28 +0000
commit41b794c77d881e29b260d5fccd14293af499b768 (patch)
tree4883b724529a1f64b45cb666e3f3764a945bfb5a /src/io.c
parent48fff1e2284aed7ea44eb6ac23b00166c1225038 (diff)
downloaddistcc-git-41b794c77d881e29b260d5fccd14293af499b768.tar.gz
Turned all tabs into 4 spaces. Got rid of whitespace at the end of
lines. Fixed up resulting mis-indented code I noticed (mostly in files that used 8 space indents, or used 4-space and 8-space indents in the same file (!)). Added the emacs tab-var setting for all files, not just some of them. I also added in copyright notices for files I noticed that didn't have them. We'll want to do another pass-through to fix these up properly, though. I used the following perl snippet to check for mis-indented code after converting tabs to whitespace: $ for i in *.{c,h}; do echo $i; perl -nle 'if ($indent > 0) {$sp=" " x $indent; /^$sp[^ ]/ && print "$.: $_"; $indent=0;}; if (/^( *).*{/ ) {$indent=length($1);} else {$indent=0;}' $i; done | less It had false positives, but hopefully didn't miss anything. Reviewed by klarlund@google.com
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/io.c b/src/io.c
index f0f5fb0..8b2a1a4 100644
--- a/src/io.c
+++ b/src/io.c
@@ -1,5 +1,5 @@
/* -*- c-file-style: "java"; indent-tabs-mode: nil; tab-width: 4 fill-column: 78 -*-
- *
+ *
* distcc -- A simple distributed compiler system
*
* Copyright (C) 2002, 2003, 2004 by Martin Pool
@@ -13,7 +13,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -133,7 +133,7 @@ int dcc_select_for_write(int fd, int timeout)
FD_SET(fd, &write_fds);
FD_SET(fd, &except_fds);
rs_trace("select for write on fd%d", fd);
-
+
rs = select(fd + 1, NULL, &write_fds, &except_fds, &tv);
if (rs == -1 && errno == EINTR) {
@@ -174,7 +174,7 @@ int dcc_readx(int fd, void *buf, size_t len)
int ret;
while (len > 0) {
- r = read(fd, buf, len);
+ r = read(fd, buf, len);
if (r == -1 && errno == EAGAIN) {
if ((ret = dcc_select_for_read(fd, dcc_io_timeout)))
@@ -184,15 +184,15 @@ int dcc_readx(int fd, void *buf, size_t len)
} else if (r == -1 && errno == EINTR) {
continue;
} else if (r == -1) {
- rs_log_error("failed to read: %s", strerror(errno));
- return EXIT_IO_ERROR;
- } else if (r == 0) {
- rs_log_error("unexpected eof on fd%d", fd);
- return EXIT_TRUNCATED;
- } else {
- buf = &((char *) buf)[r];
- len -= r;
- }
+ rs_log_error("failed to read: %s", strerror(errno));
+ return EXIT_IO_ERROR;
+ } else if (r == 0) {
+ rs_log_error("unexpected eof on fd%d", fd);
+ return EXIT_TRUNCATED;
+ } else {
+ buf = &((char *) buf)[r];
+ len -= r;
+ }
}
return 0;
@@ -209,7 +209,7 @@ int dcc_writex(int fd, const void *buf, size_t len)
{
ssize_t r;
int ret;
-
+
while (len > 0) {
r = write(fd, buf, len);