Date: Tue, 3 Apr 2018 18:33:03 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r331932 - user/pho/stress2/misc Message-ID: <201804031833.w33IX3ef082593@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Tue Apr 3 18:33:03 2018 New Revision: 331932 URL: https://svnweb.freebsd.org/changeset/base/331932 Log: Indentation fixups. No functional changes. Modified: user/pho/stress2/misc/sendfile.sh Modified: user/pho/stress2/misc/sendfile.sh ============================================================================== --- user/pho/stress2/misc/sendfile.sh Tue Apr 3 17:16:06 2018 (r331931) +++ user/pho/stress2/misc/sendfile.sh Tue Apr 3 18:33:03 2018 (r331932) @@ -110,16 +110,17 @@ reader(void) { t = 0; if ((buf = malloc(bufsize)) == NULL) - err(1, "malloc(%d), %s:%d", bufsize, __FILE__, __LINE__); + err(1, "malloc(%d), %s:%d", bufsize, __FILE__, __LINE__); if ((fd = open(outputFile, O_RDWR | O_CREAT | O_TRUNC, 0640)) == -1) - err(1, "open(%s)", outputFile); + err(1, "open(%s)", outputFile); for (;;) { if ((n = read(msgsock, buf, bufsize)) < 0) err(1, "read(), %s:%d", __FILE__, __LINE__); t += n; - if (n == 0) break; + if (n == 0) + break; if ((write(fd, buf, n)) != n) err(1, "write"); @@ -152,9 +153,10 @@ writer(void) { #if 1 /* livelock trigger */ size = getpagesize() -4; - if (setsockopt(tcpsock, - SOL_SOCKET, SO_SNDBUF, (void *)&size, sizeof(size)) < 0) - err(1, "setsockopt(SO_SNDBUF), %s:%d", __FILE__, __LINE__); + if (setsockopt(tcpsock, SOL_SOCKET, SO_SNDBUF, (void *)&size, + sizeof(size)) < 0) + err(1, "setsockopt(SO_SNDBUF), %s:%d", + __FILE__, __LINE__); #endif hostent = gethostbyname ("localhost"); @@ -194,8 +196,9 @@ main(int argc, char **argv) pid_t pid; if (argc != 4) { - fprintf(stderr, "Usage: %s <inputFile outputFile portNumber\n", argv[0]); - return (1); + fprintf(stderr, "Usage: %s <inputFile outputFile portNumber\n", + argv[0]); + return (1); } inputFile = argv[1]; outputFile = argv[2]; @@ -204,7 +207,6 @@ main(int argc, char **argv) if ((pid = fork()) == 0) { writer(); exit(EXIT_SUCCESS); - } else if (pid > 0) { reader(); kill(pid, SIGINT);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804031833.w33IX3ef082593>