git » libjio » commit fa198ff

samples/full.c: Bring it up to date with API changes

author Alberto Bertogli
2009-03-18 04:39:17 UTC
committer Alberto Bertogli
2009-03-18 04:39:17 UTC
parent 29a7cd7f4f0520ce84deb1b4a8336556e5418a59

samples/full.c: Bring it up to date with API changes

This patch fixes two small API-related issues in samples/full.c: the
introduction of the jdir parameter (in this case, NULL), and the fact that
we assume read-only mode unless O_RDWR is specified.

Thanks to Chris Riddoch for the bug report.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

samples/full.c +3 -3

diff --git a/samples/full.c b/samples/full.c
index 90a009e..83e069c 100644
--- a/samples/full.c
+++ b/samples/full.c
@@ -17,11 +17,11 @@ int main(void)
 	struct jfsck_result result;
 
 	/* check the file is OK */
-	jfsck(FILENAME, &result);
-	jfsck_cleanup(FILENAME);
+	jfsck(FILENAME, NULL, &result);
+	jfsck_cleanup(FILENAME, NULL);
 
 	/* and open it */
-	r = jopen(&file, FILENAME, O_SYNC | O_CREAT | O_TRUNC, 0600, 0);
+	r = jopen(&file, FILENAME, O_RDWR | O_CREAT | O_TRUNC, 0600, 0);
 	if (r < 0) {
 		perror("jopen");
 		return 1;