repositories
/
deb_libnfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4e9dcb7
)
[fix] - fixed example - don't exit on read failure during dirent (it could be a direc...
author
Memphiz
<memphis@machzwo.de>
Mon, 12 Sep 2011 16:46:57 +0000
(18:46 +0200)
committer
Memphiz
<memphis@machzwo.de>
Mon, 12 Sep 2011 16:46:57 +0000
(18:46 +0200)
- fixed sprintf pointer
examples/nfsclient-sync.c
patch
|
blob
|
blame
|
history
diff --git
a/examples/nfsclient-sync.c
b/examples/nfsclient-sync.c
index 449d8e3342d8abaf1764bf8b3d095a6315e8930a..a481652f01489c0fc05c91891bd10ef060efb504 100644
(file)
--- a/
examples/nfsclient-sync.c
+++ b/
examples/nfsclient-sync.c
@@
-221,7
+221,7
@@
int main(int argc _U_, char *argv[] _U_)
while((nfsdirent = nfs_readdir(nfs, nfsdir)) != NULL) {
char filename[1024];
printf("Inode:%d Name:%s ", (int)nfsdirent->inode, nfsdirent->name);
while((nfsdirent = nfs_readdir(nfs, nfsdir)) != NULL) {
char filename[1024];
printf("Inode:%d Name:%s ", (int)nfsdirent->inode, nfsdirent->name);
- sprintf(
&
filename, "%s/%s", NFSDIR, nfsdirent->name);
+ sprintf(filename, "%s/%s", NFSDIR, nfsdirent->name);
ret = nfs_open(nfs, filename, O_RDONLY, &nfsfh);
if (ret != 0) {
printf("Failed to open(%s) %s\n", filename, nfs_get_error(nfs));
ret = nfs_open(nfs, filename, O_RDONLY, &nfsfh);
if (ret != 0) {
printf("Failed to open(%s) %s\n", filename, nfs_get_error(nfs));
@@
-230,7
+230,6
@@
int main(int argc _U_, char *argv[] _U_)
ret = nfs_read(nfs, nfsfh, sizeof(buf), buf);
if (ret < 0) {
printf("Error reading file\n");
ret = nfs_read(nfs, nfsfh, sizeof(buf), buf);
if (ret < 0) {
printf("Error reading file\n");
- exit(10);
}
printf("Read %d bytes\n", ret);
ret = nfs_close(nfs, nfsfh);
}
printf("Read %d bytes\n", ret);
ret = nfs_close(nfs, nfsfh);