diff options
author | Theodore Ts'o <tytso@mit.edu> | 2008-08-27 23:07:54 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-08-27 23:07:54 -0400 |
commit | efc6f628e15de95bcd13e4f0ee223cb42115d520 (patch) | |
tree | 7f486b4bc1a4c8fc47f236f1e95e33feee745f7c /util | |
parent | 4690e621acd4579dae60b6f55f58284ee805e86d (diff) | |
download | e2fsprogs-efc6f628e15de95bcd13e4f0ee223cb42115d520.tar.gz |
Remove trailing whitespace for the entire source tree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'util')
-rw-r--r-- | util/copy_sparse.c | 14 | ||||
-rw-r--r-- | util/subst.c | 20 |
2 files changed, 17 insertions, 17 deletions
diff --git a/util/copy_sparse.c b/util/copy_sparse.c index aece6be2..cbab273e 100644 --- a/util/copy_sparse.c +++ b/util/copy_sparse.c @@ -1,7 +1,7 @@ /* * copy_sparse.c -- copy a very large sparse files efficiently * (requires root privileges) - * + * * Copyright 2003, 2004 by Theodore Ts'o. * * %Begin-Header% @@ -70,7 +70,7 @@ static int full_read(int fd, char *buf, size_t count) while (count > 0) { got = read(fd, buf, count); if (got == -1) { - if ((errno == EINTR) || (errno == EAGAIN)) + if ((errno == EINTR) || (errno == EAGAIN)) continue; return total ? total : -1; } @@ -97,7 +97,7 @@ static void copy_sparse_file(const char *src, const char *dest) if (verbose) printf("Copying sparse file from %s to %s\n", src, dest); - + if (strcmp(src, "-")) { if (stat64(src, &fileinfo) < 0) { perror("stat"); @@ -125,13 +125,13 @@ static void copy_sparse_file(const char *src, const char *dest) printf("Blocksize of file %s is %ld\n", src, bs); numblocks = (fileinfo.st_size + (bs-1)) / bs; if (verbose) - printf("File size of %s is %lld (%ld blocks)\n", src, + printf("File size of %s is %lld (%ld blocks)\n", src, (long long) fileinfo.st_size, numblocks); } else { fd = 0; bs = 1024; } - + ofd = open(dest, O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0777); if (ofd < 0) { perror(dest); @@ -143,7 +143,7 @@ static void copy_sparse_file(const char *src, const char *dest) fprintf(stderr, "Couldn't allocate buffer"); exit(1); } - + for (lb = 0; !fd || lb < numblocks; lb++) { if (fd) { block = get_bmap(fd, lb); @@ -170,7 +170,7 @@ static void copy_sparse_file(const char *src, const char *dest) break; if (got == bs) { - for (i=0; i < bs; i++) + for (i=0; i < bs; i++) if (buf[i]) break; if (i == bs) { diff --git a/util/subst.c b/util/subst.c index fadf3287..0015a9c4 100644 --- a/util/subst.c +++ b/util/subst.c @@ -2,7 +2,7 @@ * subst.c --- substitution program * * Subst is used as a quicky program to do @ substitutions - * + * */ #include <stdio.h> @@ -36,7 +36,7 @@ static int add_subst(char *name, char *value) { struct subst_entry *ent = 0; int retval; - + retval = ENOMEM; ent = (struct subst_entry *) malloc(sizeof(struct subst_entry)); if (!ent) @@ -91,7 +91,7 @@ static char *get_subst_symbol(const char *begin, size_t len, char prefix) return NULL; memcpy(start, begin, len); start[len] = 0; - + /* * The substitution variable must all be in the of [0-9A-Za-z_]. * If it isn't, this must be an invalid symbol name. @@ -154,7 +154,7 @@ static void substitute_line(char *line) } ent = fetch_subst_entry(replace_name); if (!ent) { - fprintf(stderr, "Unfound expansion: '%s'\n", + fprintf(stderr, "Unfound expansion: '%s'\n", replace_name); ptr = end_ptr + 1; continue; @@ -167,7 +167,7 @@ static void substitute_line(char *line) replace_string(ptr, end_ptr, ent->value); if ((ent->value[0] == '@') && (strlen(replace_name) == strlen(ent->value)-2) && - !strncmp(replace_name, ent->value+1, + !strncmp(replace_name, ent->value+1, strlen(ent->value)-2)) /* avoid an infinite loop */ ptr += strlen(ent->value); @@ -193,7 +193,7 @@ static void substitute_line(char *line) if (!replace_name) { ptr = name_ptr; continue; - } + } ent = fetch_subst_entry(replace_name); if (!ent) { ptr = end_ptr + 1; @@ -313,7 +313,7 @@ int main(int argc, char **argv) int adjust_timestamp = 0; struct stat stbuf; struct utimbuf ut; - + while ((c = getopt (argc, argv, "f:tv")) != EOF) { switch (c) { case 'f': @@ -332,7 +332,7 @@ int main(int argc, char **argv) verbose++; break; default: - fprintf(stderr, "%s: [-f config-file] [file]\n", + fprintf(stderr, "%s: [-f config-file] [file]\n", argv[0]); break; } @@ -346,7 +346,7 @@ int main(int argc, char **argv) optind++; } else in = stdin; - + if (optind < argc) { outfn = argv[optind]; newfn = (char *) malloc(strlen(outfn)+20); @@ -365,7 +365,7 @@ int main(int argc, char **argv) out = stdout; outfn = 0; } - + while (!feof(in)) { if (fgets(line, sizeof(line), in) == NULL) break; |