summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-11-08 14:39:28 -0500
committerSteve Dickson <steved@redhat.com>2012-11-11 18:01:23 -0500
commit1a0020edd06dde37f3ad7168f141645f07a050c7 (patch)
tree2f16ddb4c1dc429a9a4c67c78b9efe8d94496c66
parent37ebcfc42478bbbf5784504072b682037352a90e (diff)
downloadnfs-utils-1a0020edd06dde37f3ad7168f141645f07a050c7.zip
nfs-utils-1a0020edd06dde37f3ad7168f141645f07a050c7.tar.gz
nfs-utils-1a0020edd06dde37f3ad7168f141645f07a050c7.tar.xz
nfsdcltrack: remove pointless sqlite_topdir variable
This is holdover from an earlier version of the code and doesn't really provide any benefit. Also, mark the topdir and dirname arguments const since they should never be changed. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rwxr-xr-xutils/nfsdcltrack/nfsdcldbin64142 -> 64072 bytes
-rw-r--r--utils/nfsdcltrack/sqlite.c13
-rw-r--r--utils/nfsdcltrack/sqlite.h2
3 files changed, 5 insertions, 10 deletions
diff --git a/utils/nfsdcltrack/nfsdcld b/utils/nfsdcltrack/nfsdcld
index 47801fc..651b0c3 100755
--- a/utils/nfsdcltrack/nfsdcld
+++ b/utils/nfsdcltrack/nfsdcld
Binary files differ
diff --git a/utils/nfsdcltrack/sqlite.c b/utils/nfsdcltrack/sqlite.c
index fc882c6..c19af7e 100644
--- a/utils/nfsdcltrack/sqlite.c
+++ b/utils/nfsdcltrack/sqlite.c
@@ -61,9 +61,6 @@
/* global variables */
-/* top level DB directory */
-static char *sqlite_topdir;
-
/* reusable pathname and sql command buffer */
static char buf[PATH_MAX];
@@ -74,7 +71,7 @@ static sqlite3 *dbh;
/* make a directory, ignoring EEXIST errors unless it's not a directory */
static int
-mkdir_if_not_exist(char *dirname)
+mkdir_if_not_exist(const char *dirname)
{
int ret;
struct stat statbuf;
@@ -102,19 +99,17 @@ mkdir_if_not_exist(char *dirname)
* the "clients" table.
*/
int
-sqlite_maindb_init(char *topdir)
+sqlite_maindb_init(const char *topdir)
{
int ret;
char *err = NULL;
sqlite3_stmt *stmt = NULL;
- sqlite_topdir = topdir;
-
- ret = mkdir_if_not_exist(sqlite_topdir);
+ ret = mkdir_if_not_exist(topdir);
if (ret)
return ret;
- ret = snprintf(buf, PATH_MAX - 1, "%s/main.sqlite", sqlite_topdir);
+ ret = snprintf(buf, PATH_MAX - 1, "%s/main.sqlite", topdir);
if (ret < 0)
return ret;
diff --git a/utils/nfsdcltrack/sqlite.h b/utils/nfsdcltrack/sqlite.h
index c85e7d6..8748948 100644
--- a/utils/nfsdcltrack/sqlite.h
+++ b/utils/nfsdcltrack/sqlite.h
@@ -20,7 +20,7 @@
#ifndef _SQLITE_H_
#define _SQLITE_H_
-int sqlite_maindb_init(char *topdir);
+int sqlite_maindb_init(const char *topdir);
int sqlite_insert_client(const unsigned char *clname, const size_t namelen);
int sqlite_remove_client(const unsigned char *clname, const size_t namelen);
int sqlite_check_client(const unsigned char *clname, const size_t namelen);