diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-03-31 09:00:54 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-03-31 10:23:17 +1100 |
commit | 4fc0a6ab3151ca740e4d89b0ebca5d378f88ea50 (patch) | |
tree | 6c3b30dd789416208fad8d829190c8a89f43f637 /source4 | |
parent | 32c8feab5d8320cba7f47fc27ba0fc264f3c4333 (diff) | |
download | samba-4fc0a6ab3151ca740e4d89b0ebca5d378f88ea50.tar.gz samba-4fc0a6ab3151ca740e4d89b0ebca5d378f88ea50.tar.bz2 samba-4fc0a6ab3151ca740e4d89b0ebca5d378f88ea50.zip |
s4-torture: using typeof() is not portable
this failed to compile on solaris8 with cc
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/raw/open.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c index e37fd8e09a..42f693e78c 100644 --- a/source4/torture/raw/open.c +++ b/source4/torture/raw/open.c @@ -1787,17 +1787,9 @@ done: return ret; } -#define FILL_NTCREATEX(_struct, _init...) \ - do { \ - (_struct)->generic.level = RAW_OPEN_NTCREATEX; \ - (_struct)->ntcreatex.in \ - = (typeof((_struct)->ntcreatex.in)) {_init};\ - } while (0) - static bool test_ntcreatex_opendisp_dir(struct torture_context *tctx, struct smbcli_state *cli) { - union smb_open io; const char *dname = BASEDIR "\\torture_ntcreatex_opendisp_dir"; NTSTATUS status; bool ret = true; @@ -1822,20 +1814,21 @@ static bool test_ntcreatex_opendisp_dir(struct torture_context *tctx, { 6, true, NT_STATUS_INVALID_PARAMETER }, { 6, false, NT_STATUS_INVALID_PARAMETER }, }; + union smb_open io; + + ZERO_STRUCT(io); + io.generic.level = RAW_OPEN_NTCREATEX; + io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED; + io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; + io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_DIRECTORY; + io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ | NTCREATEX_SHARE_ACCESS_WRITE; + io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_DIRECTORY; + io.ntcreatex.in.fname = dname; if (!torture_setup_dir(cli, BASEDIR)) { return false; } - FILL_NTCREATEX(&io, - .flags = NTCREATEX_FLAGS_EXTENDED, - .access_mask = SEC_FLAG_MAXIMUM_ALLOWED, - .file_attr = FILE_ATTRIBUTE_DIRECTORY, - .share_access = NTCREATEX_SHARE_ACCESS_READ | NTCREATEX_SHARE_ACCESS_WRITE, - .create_options = NTCREATEX_OPTIONS_DIRECTORY, - .fname = dname, - ); - smbcli_rmdir(cli->tree, dname); smbcli_unlink(cli->tree, dname); |