[PATCH] connector - documentation: close opened file descriptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For the logging process, we use either a file or stdout.

In the case of a file, we need to fix that by calling fclose at the right time.
In the case we end up calling fclose to stdout, we will not impact the program because we do it at its very end.

Signed-off-by: Valentin Ilie <valentin.ilie@xxxxxxxxx>
---
 Documentation/connector/ucon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/connector/ucon.c b/Documentation/connector/ucon.c
index 8a4da64..f9d785b 100644
--- a/Documentation/connector/ucon.c
+++ b/Documentation/connector/ucon.c
@@ -246,5 +246,6 @@ int main(int argc, char *argv[])
 	}
 
 	close(s);
+	fclose(out);
 	return 0;
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux