summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2011-07-11 11:13:18 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-11 11:36:50 +0200
commit57194d8c5d47133c9145e6ed2b51f4e18f8bd1ec (patch)
treeccd265750401ee75d5a25159cf02256441747ef6 /source3
parent330c00a14d0d903b5f1accf5a17c226ca3413dc4 (diff)
downloadsamba-57194d8c5d47133c9145e6ed2b51f4e18f8bd1ec.tar.gz
samba-57194d8c5d47133c9145e6ed2b51f4e18f8bd1ec.tar.bz2
samba-57194d8c5d47133c9145e6ed2b51f4e18f8bd1ec.zip
s3-libsmb: introduce cli_lock32()
Same like cli_lock() but return NTSTATUS instead of bool Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/clifile.c16
-rw-r--r--source3/libsmb/proto.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 24a099b4ca..948d10499d 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -2580,6 +2580,22 @@ NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
note that timeout is in units of 2 milliseconds
****************************************************************************/
+NTSTATUS cli_lock32(struct cli_state *cli, uint16_t fnum,
+ uint32_t offset, uint32_t len, int timeout,
+ enum brl_type lock_type)
+{
+ NTSTATUS status;
+
+ status = cli_locktype(cli, fnum, offset, len, timeout,
+ (lock_type == READ_LOCK? 1 : 0));
+ return status;
+}
+
+/****************************************************************************
+ Lock a file.
+ note that timeout is in units of 2 milliseconds
+****************************************************************************/
+
bool cli_lock(struct cli_state *cli, uint16_t fnum,
uint32_t offset, uint32_t len, int timeout,
enum brl_type lock_type)
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 2883af2fad..906852e94f 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -390,6 +390,8 @@ NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
int timeout, unsigned char locktype);
bool cli_lock(struct cli_state *cli, uint16_t fnum,
uint32_t offset, uint32_t len, int timeout, enum brl_type lock_type);
+NTSTATUS cli_lock32(struct cli_state *cli, uint16_t fnum, uint32_t offset,
+ uint32_t len, int timeout, enum brl_type lock_type);
struct tevent_req *cli_unlock_send(TALLOC_CTX *mem_ctx,
struct event_context *ev,
struct cli_state *cli,