summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2002-08-19 16:54:06 +0000
committerSimo Sorce <idra@samba.org>2002-08-19 16:54:06 +0000
commita90c9b2ccdbb8e41c54293b57808a6c61a4be8a7 (patch)
tree0ddda1230ac5aa402d49f17bef217f218745cd79 /source3
parentd94046af25ac288014c92858dc2f9017231ab59a (diff)
downloadsamba-a90c9b2ccdbb8e41c54293b57808a6c61a4be8a7.tar.gz
samba-a90c9b2ccdbb8e41c54293b57808a6c61a4be8a7.tar.bz2
samba-a90c9b2ccdbb8e41c54293b57808a6c61a4be8a7.zip
make IRIX happy
(This used to be commit bac73fa972c24503f12968810059745c81fa57a9)
Diffstat (limited to 'source3')
-rw-r--r--source3/torture/cmd_vfs.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index 680d5bdfdc..29af3c9a5f 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -212,7 +212,9 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c
printf(" T = O_TRUNC\n");
printf(" A = O_APPEND\n");
printf(" N = O_NONBLOCK/O_NDELAY\n");
+#ifdef O_SYNC
printf(" S = O_SYNC\n");
+#endif
#ifdef O_NOFOLLOW
printf(" F = O_NOFOLLOW\n");
#endif
@@ -249,9 +251,11 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c
case 'N':
flags |= O_NONBLOCK;
break;
+#ifdef O_SYNC
case 'S':
flags |= O_SYNC;
break;
+#endif
#ifdef O_NOFOLLOW
case 'F':
flags |= O_NOFOLLOW;
@@ -288,22 +292,22 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c
static NTSTATUS cmd_pathfunc(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, char **argv)
{
int ret = -1;
- struct func_entry *fptr;
- struct func_entry func_table[] = {
- { "rmdir", vfs->conn->vfs_ops.rmdir },
- { "unlink", vfs->conn->vfs_ops.unlink },
- { "chdir", vfs->conn->vfs_ops.chdir },
- { NULL }
- };
if (argc != 2) {
printf("Usage: %s <path>\n", argv[0]);
return NT_STATUS_OK;
}
- for (fptr=func_table; *fptr->name; fptr++)
- if (strcmp(fptr->name, argv[0]) == 0 )
- ret = fptr->fn(vfs->conn, argv[1]);
+ if (strcmp("rmdir", argv[0]) == 0 ) {
+ ret = vfs->conn->vfs_ops.rmdir(vfs->conn, argv[1]);
+ } else if (strcmp("unlink", argv[0]) == 0 ) {
+ ret = vfs->conn->vfs_ops.unlink(vfs->conn, argv[1]);
+ } else if (strcmp("chdir", argv[0]) == 0 ) {
+ ret = vfs->conn->vfs_ops.chdir(vfs->conn, argv[1]);
+ } else {
+ printf("%s: error=%d (invalid function name!)\n", argv[0], errno);
+ return NT_STATUS_UNSUCCESSFUL;
+ }
if (ret == -1) {
printf("%s: error=%d (%s)\n", argv[0], errno, strerror(errno));