s3: Use tevent_req_simple_recv_ntstatus where appropriate
authorVolker Lendecke <vl@samba.org>
Sun, 24 Oct 2010 14:59:56 +0000 (16:59 +0200)
committerVolker Lendecke <vlendec@samba.org>
Sun, 24 Oct 2010 20:46:28 +0000 (20:46 +0000)
source3/libsmb/clifile.c

index 2b4645da4001bacc73c35833cc48d7aacb518b17..04a76f5c9bf9a02430967a61ada5285c342ee8ca 100644 (file)
@@ -305,12 +305,7 @@ struct tevent_req *cli_posix_symlink_send(TALLOC_CTX *mem_ctx,
 
 NTSTATUS cli_posix_symlink_recv(struct tevent_req *req)
 {
-       NTSTATUS status;
-
-       if (tevent_req_is_nterror(req, &status)) {
-               return status;
-       }
-       return NT_STATUS_OK;
+       return tevent_req_simple_recv_ntstatus(req);
 }
 
 NTSTATUS cli_posix_symlink(struct cli_state *cli,
@@ -523,12 +518,7 @@ struct tevent_req *cli_posix_hardlink_send(TALLOC_CTX *mem_ctx,
 
 NTSTATUS cli_posix_hardlink_recv(struct tevent_req *req)
 {
-       NTSTATUS status;
-
-       if (tevent_req_is_nterror(req, &status)) {
-               return status;
-       }
-       return NT_STATUS_OK;
+       return tevent_req_simple_recv_ntstatus(req);
 }
 
 NTSTATUS cli_posix_hardlink(struct cli_state *cli,
@@ -1029,12 +1019,7 @@ struct tevent_req *cli_posix_chmod_send(TALLOC_CTX *mem_ctx,
 
 NTSTATUS cli_posix_chmod_recv(struct tevent_req *req)
 {
-       NTSTATUS status;
-
-       if (tevent_req_is_nterror(req, &status)) {
-               return status;
-       }
-       return NT_STATUS_OK;
+       return tevent_req_simple_recv_ntstatus(req);
 }
 
 NTSTATUS cli_posix_chmod(struct cli_state *cli, const char *fname, mode_t mode)
@@ -1103,12 +1088,7 @@ struct tevent_req *cli_posix_chown_send(TALLOC_CTX *mem_ctx,
 
 NTSTATUS cli_posix_chown_recv(struct tevent_req *req)
 {
-       NTSTATUS status;
-
-       if (tevent_req_is_nterror(req, &status)) {
-               return status;
-       }
-       return NT_STATUS_OK;
+       return tevent_req_simple_recv_ntstatus(req);
 }
 
 NTSTATUS cli_posix_chown(struct cli_state *cli,
@@ -1889,12 +1869,7 @@ struct tevent_req *cli_nt_delete_on_close_send(TALLOC_CTX *mem_ctx,
 
 NTSTATUS cli_nt_delete_on_close_recv(struct tevent_req *req)
 {
-       NTSTATUS status;
-
-       if (tevent_req_is_nterror(req, &status)) {
-               return status;
-       }
-       return NT_STATUS_OK;
+       return tevent_req_simple_recv_ntstatus(req);
 }
 
 NTSTATUS cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag)
@@ -2500,12 +2475,7 @@ struct tevent_req *cli_ftruncate_send(TALLOC_CTX *mem_ctx,
 
 NTSTATUS cli_ftruncate_recv(struct tevent_req *req)
 {
-       NTSTATUS status;
-
-       if (tevent_req_is_nterror(req, &status)) {
-               return status;
-       }
-       return NT_STATUS_OK;
+       return tevent_req_simple_recv_ntstatus(req);
 }
 
 NTSTATUS cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size)
@@ -3071,12 +3041,7 @@ struct tevent_req *cli_posix_lock_send(TALLOC_CTX *mem_ctx,
 
 NTSTATUS cli_posix_lock_recv(struct tevent_req *req)
 {
-       NTSTATUS status;
-
-       if (tevent_req_is_nterror(req, &status)) {
-               return status;
-       }
-       return NT_STATUS_OK;
+       return tevent_req_simple_recv_ntstatus(req);
 }
 
 NTSTATUS cli_posix_lock(struct cli_state *cli, uint16_t fnum,
@@ -3152,12 +3117,7 @@ struct tevent_req *cli_posix_unlock_send(TALLOC_CTX *mem_ctx,
 
 NTSTATUS cli_posix_unlock_recv(struct tevent_req *req)
 {
-       NTSTATUS status;
-
-       if (tevent_req_is_nterror(req, &status)) {
-               return status;
-       }
-       return NT_STATUS_OK;
+       return tevent_req_simple_recv_ntstatus(req);
 }
 
 NTSTATUS cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len)
@@ -4730,12 +4690,7 @@ struct tevent_req *cli_posix_mkdir_send(TALLOC_CTX *mem_ctx,
 
 NTSTATUS cli_posix_mkdir_recv(struct tevent_req *req)
 {
-       NTSTATUS status;
-
-       if (tevent_req_is_nterror(req, &status)) {
-               return status;
-       }
-       return NT_STATUS_OK;
+       return tevent_req_simple_recv_ntstatus(req);
 }
 
 NTSTATUS cli_posix_mkdir(struct cli_state *cli, const char *fname, mode_t mode)
@@ -4872,12 +4827,7 @@ struct tevent_req *cli_posix_unlink_send(TALLOC_CTX *mem_ctx,
 
 NTSTATUS cli_posix_unlink_recv(struct tevent_req *req)
 {
-       NTSTATUS status;
-
-       if (tevent_req_is_nterror(req, &status)) {
-               return status;
-       }
-       return NT_STATUS_OK;
+       return tevent_req_simple_recv_ntstatus(req);
 }
 
 /****************************************************************************
@@ -4943,12 +4893,7 @@ struct tevent_req *cli_posix_rmdir_send(TALLOC_CTX *mem_ctx,
 
 NTSTATUS cli_posix_rmdir_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 {
-       NTSTATUS status;
-
-       if (tevent_req_is_nterror(req, &status)) {
-               return status;
-       }
-       return NT_STATUS_OK;
+       return tevent_req_simple_recv_ntstatus(req);
 }
 
 NTSTATUS cli_posix_rmdir(struct cli_state *cli, const char *fname)