git: f9d9a7cc4f2f - main - sort: deindent closefile
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 13 Oct 2022 08:42:55 UTC
The branch main has been updated by bapt:
URL: https://cgit.FreeBSD.org/src/commit/?id=f9d9a7cc4f2ff38795e5056721297e2b8442bf7a
commit f9d9a7cc4f2ff38795e5056721297e2b8442bf7a
Author: Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2022-10-13 08:38:12 +0000
Commit: Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2022-10-13 08:38:12 +0000
sort: deindent closefile
---
usr.bin/sort/file.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/usr.bin/sort/file.c b/usr.bin/sort/file.c
index 05058a2509b5..8f9d8ac89b5b 100644
--- a/usr.bin/sort/file.c
+++ b/usr.bin/sort/file.c
@@ -574,19 +574,17 @@ openfile(const char *fn, const char *mode)
void
closefile(FILE *f, const char *fn)
{
- if (f == NULL) {
- ;
- } else if (f == stdin) {
- ;
- } else if (f == stdout) {
+ if (f == NULL || f = stdin)
+ return;
+ if (f == stdout) {
fflush(f);
- } else {
- if (file_is_tmp(fn) && compress_program != NULL) {
- if(pclose(f)<0)
- err(2,NULL);
- } else
- fclose(f);
+ return;
}
+ if (file_is_tmp(fn) && compress_program != NULL) {
+ if(pclose(f)<0)
+ err(2,NULL);
+ } else
+ fclose(f);
}
/*