summaryrefslogtreecommitdiff
path: root/misc/logsave.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2008-08-27 23:07:54 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-08-27 23:07:54 -0400
commitefc6f628e15de95bcd13e4f0ee223cb42115d520 (patch)
tree7f486b4bc1a4c8fc47f236f1e95e33feee745f7c /misc/logsave.c
parent4690e621acd4579dae60b6f55f58284ee805e86d (diff)
downloade2fsprogs-efc6f628e15de95bcd13e4f0ee223cb42115d520.tar.gz
Remove trailing whitespace for the entire source tree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'misc/logsave.c')
-rw-r--r--misc/logsave.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/misc/logsave.c b/misc/logsave.c
index aa3235ee..f0011f81 100644
--- a/misc/logsave.c
+++ b/misc/logsave.c
@@ -52,10 +52,10 @@ static void usage(char *progname)
static void send_output(const char *buffer, int c, int flag)
{
char *n;
-
+
if (c == 0)
c = strlen(buffer);
-
+
if (flag & SEND_CONSOLE)
write(1, buffer, c);
if (!(flag & SEND_LOG))
@@ -147,7 +147,7 @@ static int run_program(char **argv)
dup2(fds[1],1); /* fds[1] replaces stdout */
dup2(fds[1],2); /* fds[1] replaces stderr */
close(fds[0]); /* don't need this here */
-
+
execvp(argv[0], argv);
perror(argv[0]);
exit(1);
@@ -201,8 +201,8 @@ static int copy_from_stdin(void)
bad_read = 0;
}
return 0;
-}
-
+}
+
int main(int argc, char **argv)
@@ -213,7 +213,7 @@ int main(int argc, char **argv)
int send_flag = SEND_LOG;
int do_stdin;
time_t t;
-
+
while ((c = getopt(argc, argv, "+asv")) != EOF) {
switch (c) {
case 'a':
@@ -238,7 +238,7 @@ int main(int argc, char **argv)
outfd = open(outfn, openflags, 0644);
do_stdin = !strcmp(argv[0], "-");
-
+
send_output("Log of ", 0, send_flag);
if (do_stdin)
send_output("stdin", 0, send_flag);
@@ -257,7 +257,7 @@ int main(int argc, char **argv)
rc = copy_from_stdin();
else
rc = run_program(argv);
-
+
send_output("\n", 0, send_flag);
t = time(0);
send_output(ctime(&t), 0, send_flag);
@@ -279,11 +279,11 @@ int main(int argc, char **argv)
while (outfd < 0) {
outfd = open(outfn, openflags, 0644);
sleep(1);
- }
+ }
write(outfd, outbuf, outbufsize);
free(outbuf);
}
close(outfd);
-
+
exit(rc);
}