From a243dffae86f5524c1b49c63a7314e19ad8228bd Mon Sep 17 00:00:00 2001
From: Alberto Bertogli <albertito@blitiri.com.ar>
Date: Sat, 26 Feb 2011 21:46:33 +0000
Subject: [PATCH 13/24] samples: Close the files when using the classic API

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
---
 samples/jio1.c |    3 +++
 samples/jio2.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/samples/jio1.c b/samples/jio1.c
index d45901f..1713a46 100644
--- a/samples/jio1.c
+++ b/samples/jio1.c
@@ -41,6 +41,9 @@ static int classic(void)
 	if (rv != strlen(STR))
 		perror("write()");
 
+	if (close(fd))
+		perror("close()");
+
 	return 0;
 }
 
diff --git a/samples/jio2.c b/samples/jio2.c
index e720630..08521e3 100644
--- a/samples/jio2.c
+++ b/samples/jio2.c
@@ -43,6 +43,9 @@ static int classic(void)
 	if (rv != strlen(STR))
 		perror("write()");
 
+	if (close(fd))
+		perror("close()");
+
 	return 0;
 }
 
-- 
1.6.2.2.646.gb214

