test/smtp-dummy: uncrustify

For some reason lost in the mists of time this code was indented 8 spaces.
This commit is contained in:
David Bremner 2017-08-26 11:41:40 -03:00
parent 10071f8b50
commit 1fa5bd282e

View file

@ -58,9 +58,9 @@ receive_data_to_file (FILE *peer, FILE *output)
break; break;
if (line_len < 2) if (line_len < 2)
continue; continue;
if (line[line_len-1] == '\n' && line[line_len-2] == '\r') { if (line[line_len - 1] == '\n' && line[line_len - 2] == '\r') {
line[line_len-2] = '\n'; line[line_len - 2] = '\n';
line[line_len-1] = '\0'; line[line_len - 1] = '\0';
} }
fprintf (output, "%s", fprintf (output, "%s",
line[0] == '.' ? line + 1 : line); line[0] == '.' ? line + 1 : line);
@ -119,7 +119,7 @@ do_smtp_to_file (FILE *peer, FILE *output)
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
const char * progname; const char *progname;
char *output_filename; char *output_filename;
FILE *peer_file, *output; FILE *peer_file, *output;
int sock, peer, err; int sock, peer, err;
@ -144,7 +144,7 @@ main (int argc, char *argv[])
background = 1; background = 1;
continue; continue;
} }
fprintf(stderr, "%s: unregognized option '%s'\n", fprintf (stderr, "%s: unregognized option '%s'\n",
progname, argv[1]); progname, argv[1]);
return 1; return 1;
} }
@ -188,7 +188,7 @@ main (int argc, char *argv[])
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
addr.sin_port = htons (25025); addr.sin_port = htons (25025);
addr.sin_addr = *(struct in_addr *) hostinfo->h_addr; addr.sin_addr = *(struct in_addr *) hostinfo->h_addr;
err = bind (sock, (struct sockaddr *) &addr, sizeof(addr)); err = bind (sock, (struct sockaddr *) &addr, sizeof (addr));
if (err) { if (err) {
fprintf (stderr, "Error: bind() failed: %s\n", fprintf (stderr, "Error: bind() failed: %s\n",
strerror (errno)); strerror (errno));
@ -220,17 +220,17 @@ main (int argc, char *argv[])
} }
/* Reached if pid == 0 (the child process). */ /* Reached if pid == 0 (the child process). */
/* Close stdout so that the one interested in pid value will /* Close stdout so that the one interested in pid value will
also get EOF. */ * also get EOF. */
close (STDOUT_FILENO); close (STDOUT_FILENO);
/* dup2() will re-reserve fd of stdout (1) (opportunistically), /* dup2() will re-reserve fd of stdout (1) (opportunistically),
in case fd of stderr (2) is open. If that was not open we * in case fd of stderr (2) is open. If that was not open we
don't care fd of stdout (1) either. */ * don't care fd of stdout (1) either. */
dup2 (STDERR_FILENO, STDOUT_FILENO); dup2 (STDERR_FILENO, STDOUT_FILENO);
/* This process is now out of reach of shell's job control. /* This process is now out of reach of shell's job control.
To resolve the rare but possible condition where this * To resolve the rare but possible condition where this
"daemon" is started but never connected this process will * "daemon" is started but never connected this process will
(only) have 30 seconds to exist. */ * (only) have 30 seconds to exist. */
alarm (30); alarm (30);
} }