git » libjio » commit 68e1b10

Make jfsck()'s first parameter, "name", const.

author Alberto Bertogli
2004-05-05 18:08:17 UTC
committer Alberto Bertogli
2007-07-15 12:44:27 UTC
parent c4b649d2686db990e57d736cb5ca076d0de7f8d5

Make jfsck()'s first parameter, "name", const.

Make jfsck()'s first parameter, "name", const.

Thanks to Pieter Grimmerink.

doc/libjio.3 +1 -1
libjio.c +2 -2
libjio.h +1 -1

diff --git a/doc/libjio.3 b/doc/libjio.3
index 8c9a5e0..4a8132b 100644
--- a/doc/libjio.3
+++ b/doc/libjio.3
@@ -32,7 +32,7 @@ libjio - A library for Journaled I/O
 
 .BI "void jtrans_free(struct jtrans *" ts " );
 
-.BI "int jfsck(char *" name ", struct jfsck_result *" res " );
+.BI "int jfsck(const char *" name ", struct jfsck_result *" res " );
 
 .SH STRUCTURES
 .PP
diff --git a/libjio.c b/libjio.c
index 8c1180d..a530c6c 100644
--- a/libjio.c
+++ b/libjio.c
@@ -682,7 +682,7 @@ int jclose(struct jfs *fs)
  */
 
 /* check the journal and replay the incomplete transactions */
-int jfsck(char *name, struct jfsck_result *res)
+int jfsck(const char *name, struct jfsck_result *res)
 {
 	int fd, tfd, rv, i, maxtid;
 	char jdir[PATH_MAX], jlockfile[PATH_MAX], tname[PATH_MAX];
@@ -699,7 +699,7 @@ int jfsck(char *name, struct jfsck_result *res)
 		return J_ENOENT;
 
 	fs.fd = fd;
-	fs.name = name;
+	fs.name = (char *) name;
 
 	if (!get_jdir(name, jdir))
 		return J_ENOMEM;
diff --git a/libjio.h b/libjio.h
index 409370f..012905b 100644
--- a/libjio.h
+++ b/libjio.h
@@ -86,7 +86,7 @@ int jtrans_rollback(struct jtrans *ts);
 void jtrans_free(struct jtrans *ts);
 
 /* journal checker */
-int jfsck(char *name, struct jfsck_result *res);
+int jfsck(const char *name, struct jfsck_result *res);
 
 
 /* jfs constants */