diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2022-11-17 16:09:58 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2022-11-17 16:42:30 +0000 |
commit | bacb00ab408a2178d13f33d0cd9c6622913d80a9 (patch) | |
tree | 46b61f6d74dc84718dc0c7789ac19c20d27c98a7 | |
parent | 9f9544fd92e606d13e228b713d3c4a7cad78575d (diff) | |
download | src-bacb00ab408a2178d13f33d0cd9c6622913d80a9.tar.gz src-bacb00ab408a2178d13f33d0cd9c6622913d80a9.zip |
tftpd: whitespace cleanup
-rw-r--r-- | libexec/tftpd/tftp-file.c | 4 | ||||
-rw-r--r-- | libexec/tftpd/tftp-file.h | 4 | ||||
-rw-r--r-- | libexec/tftpd/tftp-io.c | 24 | ||||
-rw-r--r-- | libexec/tftpd/tftp-io.h | 4 | ||||
-rw-r--r-- | libexec/tftpd/tftp-options.c | 20 | ||||
-rw-r--r-- | libexec/tftpd/tftp-options.h | 4 | ||||
-rw-r--r-- | libexec/tftpd/tftp-transfer.c | 24 | ||||
-rw-r--r-- | libexec/tftpd/tftp-transfer.h | 4 | ||||
-rw-r--r-- | libexec/tftpd/tftp-utils.c | 8 | ||||
-rw-r--r-- | libexec/tftpd/tftp-utils.h | 4 | ||||
-rw-r--r-- | libexec/tftpd/tftpd.c | 24 | ||||
-rw-r--r-- | usr.bin/tftp/tftp.c | 4 |
12 files changed, 64 insertions, 64 deletions
diff --git a/libexec/tftpd/tftp-file.c b/libexec/tftpd/tftp-file.c index 4ca075836f8d..ec7ade63e5a2 100644 --- a/libexec/tftpd/tftp-file.c +++ b/libexec/tftpd/tftp-file.c @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2008 Edwin Groothuis. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/libexec/tftpd/tftp-file.h b/libexec/tftpd/tftp-file.h index c9ce5e33b723..0cf32bd23a01 100644 --- a/libexec/tftpd/tftp-file.h +++ b/libexec/tftpd/tftp-file.h @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2008 Edwin Groothuis. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/libexec/tftpd/tftp-io.c b/libexec/tftpd/tftp-io.c index 71fd57c6a7be..245d73ffb871 100644 --- a/libexec/tftpd/tftp-io.c +++ b/libexec/tftpd/tftp-io.c @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2008 Edwin Groothuis. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -120,7 +120,7 @@ send_packet(int peer, uint16_t block, char *pkt, int size) return (0); } tftp_log(LOG_ERR, - "%s block %d, attempt %d failed (Error %d: %s)", + "%s block %d, attempt %d failed (Error %d: %s)", packettype(ntohs(((struct tftphdr *)(pkt))->th_opcode)), block, i, errno, strerror(errno)); sleep(t); @@ -145,7 +145,7 @@ send_error(int peer, int error) struct errmsg *pe; char buf[MAXPKTSIZE]; - if (debug&DEBUG_PACKETS) + if (debug & DEBUG_PACKETS) tftp_log(LOG_DEBUG, "Sending ERROR %d", error); DROPPACKET("send_error"); @@ -165,7 +165,7 @@ send_error(int peer, int error) tp->th_msg[length] = '\0'; length += 5; - if (debug&DEBUG_PACKETS) + if (debug & DEBUG_PACKETS) tftp_log(LOG_DEBUG, "Sending ERROR %d: %s", error, tp->th_msg); if (sendto(peer, buf, length, 0, @@ -185,7 +185,7 @@ send_wrq(int peer, char *filename, char *mode) char buf[MAXPKTSIZE]; int size; - if (debug&DEBUG_PACKETS) + if (debug & DEBUG_PACKETS) tftp_log(LOG_DEBUG, "Sending WRQ: filename: '%s', mode '%s'", filename, mode ); @@ -233,7 +233,7 @@ send_rrq(int peer, char *filename, char *mode) char buf[MAXPKTSIZE]; int size; - if (debug&DEBUG_PACKETS) + if (debug & DEBUG_PACKETS) tftp_log(LOG_DEBUG, "Sending RRQ: filename: '%s', mode '%s'", filename, mode ); @@ -282,7 +282,7 @@ send_oack(int peer) char *bp; char buf[MAXPKTSIZE]; - if (debug&DEBUG_PACKETS) + if (debug & DEBUG_PACKETS) tftp_log(LOG_DEBUG, "Sending OACK"); DROPPACKETn("send_oack", 0); @@ -328,7 +328,7 @@ send_ack(int fp, uint16_t block) int size; char buf[MAXPKTSIZE]; - if (debug&DEBUG_PACKETS) + if (debug & DEBUG_PACKETS) tftp_log(LOG_DEBUG, "Sending ACK for block %d", block); DROPPACKETn("send_ack", 0); @@ -358,7 +358,7 @@ send_data(int peer, uint16_t block, char *data, int size) struct tftphdr *pkt; int n; - if (debug&DEBUG_PACKETS) + if (debug & DEBUG_PACKETS) tftp_log(LOG_DEBUG, "Sending DATA packet %d of %d bytes", block, size); @@ -399,7 +399,7 @@ receive_packet(int peer, char *data, int size, struct sockaddr_storage *from, int n; static int timed_out; - if (debug&DEBUG_PACKETS) + if (debug & DEBUG_PACKETS) tftp_log(LOG_DEBUG, "Waiting %d seconds for packet", timeoutpacket); @@ -462,7 +462,7 @@ receive_packet(int peer, char *data, int size, struct sockaddr_storage *from, return (RP_ERROR); } - if (debug&DEBUG_PACKETS) + if (debug & DEBUG_PACKETS) tftp_log(LOG_DEBUG, "Received %d bytes in a %s packet", n, packettype(pkt->th_opcode)); diff --git a/libexec/tftpd/tftp-io.h b/libexec/tftpd/tftp-io.h index 322747cc58e5..107e37d70262 100644 --- a/libexec/tftpd/tftp-io.h +++ b/libexec/tftpd/tftp-io.h @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2008 Edwin Groothuis. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/libexec/tftpd/tftp-options.c b/libexec/tftpd/tftp-options.c index a2dd1019f811..01c47e66e9a5 100644 --- a/libexec/tftpd/tftp-options.c +++ b/libexec/tftpd/tftp-options.c @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2008 Edwin Groothuis. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -89,7 +89,7 @@ option_tsize(int peer __unused, struct tftphdr *tp __unused, int mode, if (options[OPT_TSIZE].o_request == NULL) return (0); - if (mode == RRQ) + if (mode == RRQ) asprintf(&options[OPT_TSIZE].o_reply, "%ju", (uintmax_t)stbuf->st_size); else @@ -124,7 +124,7 @@ option_timeout(int peer) } settimeouts(timeoutpacket, timeoutnetwork, maxtimeouts); - if (debug&DEBUG_OPTIONS) + if (debug & DEBUG_OPTIONS) tftp_log(LOG_DEBUG, "Setting timeout to '%s'", options[OPT_TIMEOUT].o_reply); @@ -154,7 +154,7 @@ option_rollover(int peer) options[OPT_ROLLOVER].o_reply = strdup(options[OPT_ROLLOVER].o_request); - if (debug&DEBUG_OPTIONS) + if (debug & DEBUG_OPTIONS) tftp_log(LOG_DEBUG, "Setting rollover to '%s'", options[OPT_ROLLOVER].o_reply); @@ -215,7 +215,7 @@ option_blksize(int peer) asprintf(&options[OPT_BLKSIZE].o_reply, "%d", size); segsize = size; pktsize = size + 4; - if (debug&DEBUG_OPTIONS) + if (debug & DEBUG_OPTIONS) tftp_log(LOG_DEBUG, "Setting blksize to '%s'", options[OPT_BLKSIZE].o_reply); @@ -269,7 +269,7 @@ option_blksize2(int peer __unused) asprintf(&options[OPT_BLKSIZE2].o_reply, "%d", size); segsize = size; pktsize = size + 4; - if (debug&DEBUG_OPTIONS) + if (debug & DEBUG_OPTIONS) tftp_log(LOG_DEBUG, "Setting blksize2 to '%s'", options[OPT_BLKSIZE2].o_reply); @@ -304,7 +304,7 @@ option_windowsize(int peer) asprintf(&options[OPT_WINDOWSIZE].o_reply, "%d", size); windowsize = size; - if (debug&DEBUG_OPTIONS) + if (debug & DEBUG_OPTIONS) tftp_log(LOG_DEBUG, "Setting windowsize to '%s'", options[OPT_WINDOWSIZE].o_reply); @@ -368,7 +368,7 @@ parse_options(int peer, char *buffer, uint16_t size) /* Parse the options */ cp = buffer; - options_failed = 0; + options_failed = 0; while (size > 0) { option = cp; i = get_field(peer, cp, size); @@ -381,7 +381,7 @@ parse_options(int peer, char *buffer, uint16_t size) /* We are at the end */ if (*option == '\0') break; - if (debug&DEBUG_OPTIONS) + if (debug & DEBUG_OPTIONS) tftp_log(LOG_DEBUG, "option: '%s' value: '%s'", option, value); diff --git a/libexec/tftpd/tftp-options.h b/libexec/tftpd/tftp-options.h index 713cbb12e439..cb387dba46c0 100644 --- a/libexec/tftpd/tftp-options.h +++ b/libexec/tftpd/tftp-options.h @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2008 Edwin Groothuis. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/libexec/tftpd/tftp-transfer.c b/libexec/tftpd/tftp-transfer.c index 5c037bc38f86..19854f2cc180 100644 --- a/libexec/tftpd/tftp-transfer.c +++ b/libexec/tftpd/tftp-transfer.c @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2008 Edwin Groothuis. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -76,7 +76,7 @@ tftp_send(int peer, uint16_t *block, struct tftp_stats *ts) acktry = 0; do { read_block: - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_DEBUG, "Sending block %d (window block %d)", *block, windowblock); @@ -138,7 +138,7 @@ read_block: } /* Either read failure or ERROR packet */ - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_ERR, "Aborting: %s", rp_strerror(n_ack)); goto abort; @@ -155,7 +155,7 @@ read_block: if (i == windowblock) { /* Did not recognize ACK. */ - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_DEBUG, "ACK %d out of window", rp->th_block); @@ -180,7 +180,7 @@ read_block: /* ACKed at least some data. */ acktry = 0; for (j = 0; j <= i; j++) { - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_DEBUG, "ACKed block %d", window[j].block); @@ -193,7 +193,7 @@ read_block: * un-ACKed block. */ if (i + 1 != windowblock) { - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_DEBUG, "Partial ACK"); if (seek_file(window[i + 1].offset) != @@ -307,7 +307,7 @@ tftp_receive(int peer, uint16_t *block, struct tftp_stats *ts, } for (retry = 0; ; retry++) { - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_DEBUG, "Receiving DATA block %d (window block %d)", *block, windowblock); @@ -331,7 +331,7 @@ tftp_receive(int peer, uint16_t *block, struct tftp_stats *ts, } /* Either read failure or ERROR packet */ - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_DEBUG, "Aborting: %s", rp_strerror(n_data)); goto abort; @@ -357,7 +357,7 @@ tftp_receive(int peer, uint16_t *block, struct tftp_stats *ts, windowstart = 0; if (rp->th_block > windowstart && rp->th_block < *block) { - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_DEBUG, "Ignoring duplicate DATA block %d", rp->th_block); @@ -365,7 +365,7 @@ tftp_receive(int peer, uint16_t *block, struct tftp_stats *ts, retry = 0; continue; } - + tftp_log(LOG_WARNING, "Expected DATA block %d, got block %d", *block, rp->th_block); @@ -423,7 +423,7 @@ send_ack: continue; } - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_DEBUG, "Sent ACK for %d", *block); windowblock = 0; break; diff --git a/libexec/tftpd/tftp-transfer.h b/libexec/tftpd/tftp-transfer.h index a39b1eca86ce..cc575ddd8774 100644 --- a/libexec/tftpd/tftp-transfer.h +++ b/libexec/tftpd/tftp-transfer.h @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2008 Edwin Groothuis. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/libexec/tftpd/tftp-utils.c b/libexec/tftpd/tftp-utils.c index 24ce505ab812..322b5ad9ae62 100644 --- a/libexec/tftpd/tftp-utils.c +++ b/libexec/tftpd/tftp-utils.c @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2008 Edwin Groothuis. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -66,11 +66,11 @@ int settimeouts(int _timeoutpacket, int _timeoutnetwork, int _maxtimeouts __unused) { int i; - + /* We cannot do impossible things */ if (_timeoutpacket >= _timeoutnetwork) return (0); - + maxtimeouts = 0; i = _timeoutpacket; while (i < _timeoutnetwork || maxtimeouts < MIN_TIMEOUTS) { diff --git a/libexec/tftpd/tftp-utils.h b/libexec/tftpd/tftp-utils.h index 0d251874f1fc..8140841a3e6e 100644 --- a/libexec/tftpd/tftp-utils.h +++ b/libexec/tftpd/tftp-utils.h @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2008 Edwin Groothuis. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index 02df60c87734..c592a592bf7f 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -300,7 +300,7 @@ main(int argc, char *argv[]) request_set(&req, RQ_DAEMON, "tftpd", 0); if (hosts_access(&req) == 0) { - if (debug&DEBUG_ACCESS) + if (debug & DEBUG_ACCESS) tftp_log(LOG_WARNING, "Access denied by 'tftpd' entry " "in /etc/hosts.allow"); @@ -321,7 +321,7 @@ main(int argc, char *argv[]) exit(1); } - if (debug&DEBUG_ACCESS) { + if (debug & DEBUG_ACCESS) { if (allow_ro) tftp_log(LOG_WARNING, "But allowed readonly access " @@ -332,7 +332,7 @@ main(int argc, char *argv[]) "via 'tftpd-wo' entry"); } } else - if (debug&DEBUG_ACCESS) + if (debug & DEBUG_ACCESS) tftp_log(LOG_WARNING, "Full access allowed" "in /etc/hosts.allow"); @@ -597,13 +597,13 @@ tftp_rrq(int peer, char *recvbuffer, ssize_t size) n = receive_packet(peer, lrecvbuffer, MAXPKTSIZE, NULL, timeoutpacket); if (n < 0) { - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_DEBUG, "Aborting: %s", rp_strerror(n)); return; } if (rp->th_opcode != ACK) { - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_DEBUG, "Expected ACK, got %s on OACK", packettype(rp->th_opcode)); @@ -668,7 +668,7 @@ find_next_name(char *filename, int *fd) for (i = 0; i < 100; i++) { sprintf(newname, "%s.%s.%02d", filename, yyyymmdd, i); *fd = open(newname, - O_WRONLY | O_CREAT | O_EXCL, + O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); if (*fd > 0) @@ -789,8 +789,8 @@ validate_access(int peer, char **filep, int mode) return (error + 100); } else fd = open(filename, - O_WRONLY | O_TRUNC | O_CREAT, - S_IRUSR | S_IWUSR | S_IRGRP | + O_WRONLY | O_TRUNC | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH ); } else fd = open(filename, O_WRONLY | O_TRUNC); @@ -814,14 +814,14 @@ tftp_xmitfile(int peer, const char *mode) memset(&ts, 0, sizeof(ts)); now = time(NULL); - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_DEBUG, "Transmitting file"); read_init(0, file, mode); block = 1; tftp_send(peer, &block, &ts); read_close(); - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_INFO, "Sent %jd bytes in %jd seconds", (intmax_t)ts.amount, (intmax_t)time(NULL) - now); } @@ -834,7 +834,7 @@ tftp_recvfile(int peer, const char *mode) struct tftp_stats ts; gettimeofday(&now1, NULL); - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) tftp_log(LOG_DEBUG, "Receiving file"); write_init(0, file, mode); @@ -844,7 +844,7 @@ tftp_recvfile(int peer, const char *mode) gettimeofday(&now2, NULL); - if (debug&DEBUG_SIMPLE) { + if (debug & DEBUG_SIMPLE) { double f; if (now1.tv_usec > now2.tv_usec) { now2.tv_usec += 1000000; diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c index 7a0565c5bdcd..31fefd8f22e2 100644 --- a/usr.bin/tftp/tftp.c +++ b/usr.bin/tftp/tftp.c @@ -96,7 +96,7 @@ xmitfile(int peer, char *port, int fd, char *name, char *mode) struct sockaddr_storage from; /* Tell the other side what we want to do */ - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) printf("Sending %s\n", name); n = send_wrq(peer, name, mode); @@ -196,7 +196,7 @@ recvfile(int peer, char *port, int fd, char *name, char *mode) struct sockaddr_storage from; /* Tell the other side what we want to do */ - if (debug&DEBUG_SIMPLE) + if (debug & DEBUG_SIMPLE) printf("Requesting %s\n", name); n = send_rrq(peer, name, mode); |