From dc3ed8c3ab12198c76bed11103e807844c5982c3 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Thu, 26 Dec 2013 10:40:37 -0800 Subject: [PATCH] Fix some compiler warnings and bugs Add missing %s to two example programs and fix incorrect argument to rpc_nfs3_fsinfo_async() --- examples/nfs-ls.c | 2 +- examples/nfsclient-sync.c | 4 ++-- lib/libnfs.c | 2 +- nfs/nfs.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/nfs-ls.c b/examples/nfs-ls.c index 6efbbd6..e87ffa8 100644 --- a/examples/nfs-ls.c +++ b/examples/nfs-ls.c @@ -100,7 +100,7 @@ void process_dir(struct nfs_context *nfs, char *dir, int level) { ret = nfs_opendir(nfs, dir, &nfsdir); if (ret != 0) { - printf("Failed to opendir(\"%s\")\n", dir, nfs_get_error(nfs)); + printf("Failed to opendir(\"%s\") %s\n", dir, nfs_get_error(nfs)); exit(10); } while((nfsdirent = nfs_readdir(nfs, nfsdir)) != NULL) { diff --git a/examples/nfsclient-sync.c b/examples/nfsclient-sync.c index 9ca58b4..29a4daf 100644 --- a/examples/nfsclient-sync.c +++ b/examples/nfsclient-sync.c @@ -163,7 +163,7 @@ int main(int argc, char *argv[]) ret = nfs_opendir(nfs, "/", &nfsdir); if (ret != 0) { - printf("Failed to opendir(\"/\")\n", nfs_get_error(nfs)); + printf("Failed to opendir(\"/\") %s\n", nfs_get_error(nfs)); exit(10); } while((nfsdirent = nfs_readdir(nfs, nfsdir)) != NULL) { @@ -212,7 +212,7 @@ int main(int argc, char *argv[]) "-w"[!!(st.st_mode & S_IWOTH)], "-x"[!!(st.st_mode & S_IXOTH)] ); - printf(" %2d", st.st_nlink); + printf(" %2d", (int)st.st_nlink); printf(" %5d", st.st_uid); printf(" %5d", st.st_gid); printf(" %12" PRId64, st.st_size); diff --git a/lib/libnfs.c b/lib/libnfs.c index 7f4cab6..77645b1 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -652,7 +652,7 @@ static void nfs_mount_7_cb(struct rpc_context *rpc, int status, void *command_da return; } - if (rpc_nfs_null_async(rpc, nfs_mount_8_cb, data) != 0) { + if (rpc_nfs3_null_async(rpc, nfs_mount_8_cb, data) != 0) { data->cb(-ENOMEM, nfs, command_data, data->private_data); free_nfs_cb_data(data); return; diff --git a/nfs/nfs.c b/nfs/nfs.c index ab8e4df..a97d40a 100644 --- a/nfs/nfs.c +++ b/nfs/nfs.c @@ -771,7 +771,7 @@ int rpc_nfs_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, args.fsroot.data.data_len = fh->data.data_len; args.fsroot.data.data_val = fh->data.data_val; - return rpc_nfs3_fsinfo_async(rpc, cb, fh, private_data); + return rpc_nfs3_fsinfo_async(rpc, cb, &args, private_data); } int rpc_nfs3_readlink_async(struct rpc_context *rpc, rpc_cb cb, READLINK3args *args, void *private_data) -- 2.34.1