From 6aa12fcb30c8f7246fd0215b1d808191c0d87668 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 5 Apr 2012 14:53:08 +1000 Subject: build: Remove SMB_OFF_T, replace with off_t Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T. Andrew Bartlett Autobuild-User: Andrew Bartlett Autobuild-Date: Fri Apr 6 01:47:43 CEST 2012 on sn-devel-104 --- source3/libsmb/clifile.c | 16 ++++++++-------- source3/libsmb/clirap.c | 10 +++++----- source3/libsmb/clirap.h | 10 +++++----- source3/libsmb/clireadwrite.c | 20 ++++++++++---------- source3/libsmb/libsmb_dir.c | 2 +- source3/libsmb/libsmb_file.c | 8 ++++---- source3/libsmb/libsmb_stat.c | 6 +++--- source3/libsmb/libsmb_xattr.c | 6 +++--- source3/libsmb/proto.h | 16 ++++++++-------- 9 files changed, 47 insertions(+), 47 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 1a67bcdd98..38b95e2457 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -3238,7 +3238,7 @@ struct cli_getattrE_state { uint16_t vwv[1]; int zone_offset; uint16_t attr; - SMB_OFF_T size; + off_t size; time_t change_time; time_t access_time; time_t write_time; @@ -3288,7 +3288,7 @@ static void cli_getattrE_done(struct tevent_req *subreq) return; } - state->size = (SMB_OFF_T)IVAL(vwv+6,0); + state->size = (off_t)IVAL(vwv+6,0); state->attr = SVAL(vwv+10,0); state->change_time = make_unix_date2(vwv+0, state->zone_offset); state->access_time = make_unix_date2(vwv+2, state->zone_offset); @@ -3299,7 +3299,7 @@ static void cli_getattrE_done(struct tevent_req *subreq) NTSTATUS cli_getattrE_recv(struct tevent_req *req, uint16_t *attr, - SMB_OFF_T *size, + off_t *size, time_t *change_time, time_t *access_time, time_t *write_time) @@ -3332,7 +3332,7 @@ NTSTATUS cli_getattrE_recv(struct tevent_req *req, NTSTATUS cli_getattrE(struct cli_state *cli, uint16_t fnum, uint16_t *attr, - SMB_OFF_T *size, + off_t *size, time_t *change_time, time_t *access_time, time_t *write_time) @@ -3388,7 +3388,7 @@ static void cli_getatr_done(struct tevent_req *subreq); struct cli_getatr_state { int zone_offset; uint16_t attr; - SMB_OFF_T size; + off_t size; time_t write_time; }; @@ -3449,7 +3449,7 @@ static void cli_getatr_done(struct tevent_req *subreq) } state->attr = SVAL(vwv+0,0); - state->size = (SMB_OFF_T)IVAL(vwv+3,0); + state->size = (off_t)IVAL(vwv+3,0); state->write_time = make_unix_date3(vwv+1, state->zone_offset); tevent_req_done(req); @@ -3457,7 +3457,7 @@ static void cli_getatr_done(struct tevent_req *subreq) NTSTATUS cli_getatr_recv(struct tevent_req *req, uint16_t *attr, - SMB_OFF_T *size, + off_t *size, time_t *write_time) { struct cli_getatr_state *state = tevent_req_data( @@ -3482,7 +3482,7 @@ NTSTATUS cli_getatr_recv(struct tevent_req *req, NTSTATUS cli_getatr(struct cli_state *cli, const char *fname, uint16_t *attr, - SMB_OFF_T *size, + off_t *size, time_t *write_time) { TALLOC_CTX *frame = talloc_stackframe(); diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index b20d089382..2815243f2f 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -620,7 +620,7 @@ NTSTATUS cli_qpathinfo1_recv(struct tevent_req *req, time_t *change_time, time_t *access_time, time_t *write_time, - SMB_OFF_T *size, + off_t *size, uint16 *mode) { struct cli_qpathinfo1_state *state = tevent_req_data( @@ -662,7 +662,7 @@ NTSTATUS cli_qpathinfo1(struct cli_state *cli, time_t *change_time, time_t *access_time, time_t *write_time, - SMB_OFF_T *size, + off_t *size, uint16 *mode) { TALLOC_CTX *frame = talloc_stackframe(); @@ -797,7 +797,7 @@ NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req, struct timespec *access_time, struct timespec *write_time, struct timespec *change_time, - SMB_OFF_T *size, uint16 *mode, + off_t *size, uint16 *mode, SMB_INO_T *ino) { struct cli_qpathinfo2_state *state = tevent_req_data( @@ -837,7 +837,7 @@ NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname, struct timespec *access_time, struct timespec *write_time, struct timespec *change_time, - SMB_OFF_T *size, uint16 *mode, + off_t *size, uint16 *mode, SMB_INO_T *ino) { TALLOC_CTX *frame = talloc_stackframe(); @@ -1114,7 +1114,7 @@ NTSTATUS cli_qfilename(struct cli_state *cli, uint16_t fnum, ****************************************************************************/ NTSTATUS cli_qfileinfo_basic(struct cli_state *cli, uint16_t fnum, - uint16 *mode, SMB_OFF_T *size, + uint16 *mode, off_t *size, struct timespec *create_time, struct timespec *access_time, struct timespec *write_time, diff --git a/source3/libsmb/clirap.h b/source3/libsmb/clirap.h index de770dba7e..32f1b11e1b 100644 --- a/source3/libsmb/clirap.h +++ b/source3/libsmb/clirap.h @@ -49,14 +49,14 @@ NTSTATUS cli_qpathinfo1_recv(struct tevent_req *req, time_t *change_time, time_t *access_time, time_t *write_time, - SMB_OFF_T *size, + off_t *size, uint16 *mode); NTSTATUS cli_qpathinfo1(struct cli_state *cli, const char *fname, time_t *change_time, time_t *access_time, time_t *write_time, - SMB_OFF_T *size, + off_t *size, uint16 *mode); NTSTATUS cli_setpathinfo_basic(struct cli_state *cli, const char *fname, time_t create_time, @@ -73,14 +73,14 @@ NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req, struct timespec *access_time, struct timespec *write_time, struct timespec *change_time, - SMB_OFF_T *size, uint16 *mode, + off_t *size, uint16 *mode, SMB_INO_T *ino); NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname, struct timespec *create_time, struct timespec *access_time, struct timespec *write_time, struct timespec *change_time, - SMB_OFF_T *size, uint16 *mode, + off_t *size, uint16 *mode, SMB_INO_T *ino); struct tevent_req *cli_qpathinfo_streams_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, @@ -97,7 +97,7 @@ NTSTATUS cli_qpathinfo_streams(struct cli_state *cli, const char *fname, NTSTATUS cli_qfilename(struct cli_state *cli, uint16_t fnum, TALLOC_CTX *mem_ctx, char **name); NTSTATUS cli_qfileinfo_basic(struct cli_state *cli, uint16_t fnum, - uint16 *mode, SMB_OFF_T *size, + uint16 *mode, off_t *size, struct timespec *create_time, struct timespec *access_time, struct timespec *write_time, diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c index 8e845ee637..8f137c0e81 100644 --- a/source3/libsmb/clireadwrite.c +++ b/source3/libsmb/clireadwrite.c @@ -415,7 +415,7 @@ struct cli_pull_state { struct cli_state *cli; uint16_t fnum; off_t start_offset; - SMB_OFF_T size; + off_t size; NTSTATUS (*sink)(char *buf, size_t n, void *priv); void *priv; @@ -432,7 +432,7 @@ struct cli_pull_state { /* * For how many bytes did we send requests already? */ - SMB_OFF_T requested; + off_t requested; /* * Next request index to push into "sink". This walks around the "req" @@ -446,7 +446,7 @@ struct cli_pull_state { * How many bytes did we push into "sink"? */ - SMB_OFF_T pushed; + off_t pushed; }; static char *cli_pull_print(struct tevent_req *req, TALLOC_CTX *mem_ctx) @@ -475,7 +475,7 @@ struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx, struct event_context *ev, struct cli_state *cli, uint16_t fnum, off_t start_offset, - SMB_OFF_T size, size_t window_size, + off_t size, size_t window_size, NTSTATUS (*sink)(char *buf, size_t n, void *priv), void *priv) @@ -528,7 +528,7 @@ struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx, for (i=0; inum_reqs; i++) { struct cli_pull_subreq *subreq = &state->reqs[i]; - SMB_OFF_T size_left; + off_t size_left; size_t request_thistime; if (state->requested >= size) { @@ -629,7 +629,7 @@ static void cli_pull_read_done(struct tevent_req *subreq) if (state->requested < state->size) { struct tevent_req *new_req; - SMB_OFF_T size_left; + off_t size_left; size_t request_thistime; size_left = state->size - state->requested; @@ -664,7 +664,7 @@ static void cli_pull_read_done(struct tevent_req *subreq) tevent_req_done(req); } -NTSTATUS cli_pull_recv(struct tevent_req *req, SMB_OFF_T *received) +NTSTATUS cli_pull_recv(struct tevent_req *req, off_t *received) { struct cli_pull_state *state = tevent_req_data( req, struct cli_pull_state); @@ -678,9 +678,9 @@ NTSTATUS cli_pull_recv(struct tevent_req *req, SMB_OFF_T *received) } NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum, - off_t start_offset, SMB_OFF_T size, size_t window_size, + off_t start_offset, off_t size, size_t window_size, NTSTATUS (*sink)(char *buf, size_t n, void *priv), - void *priv, SMB_OFF_T *received) + void *priv, off_t *received) { TALLOC_CTX *frame = talloc_stackframe(); struct event_context *ev; @@ -732,7 +732,7 @@ NTSTATUS cli_read(struct cli_state *cli, uint16_t fnum, size_t *nread) { NTSTATUS status; - SMB_OFF_T ret; + off_t ret; status = cli_pull(cli, fnum, offset, size, size, cli_read_sink, &buf, &ret); diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c index ef93dd064b..61d1a726da 100644 --- a/source3/libsmb/libsmb_dir.c +++ b/source3/libsmb/libsmb_dir.c @@ -1818,7 +1818,7 @@ SMBC_unlink_ctx(SMBCCTX *context, if (errno == EACCES) { /* Check if the file is a directory */ int saverr = errno; - SMB_OFF_T size = 0; + off_t size = 0; uint16 mode = 0; struct timespec write_time_ts; struct timespec access_time_ts; diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c index b5932c8164..c09011bb0a 100644 --- a/source3/libsmb/libsmb_file.c +++ b/source3/libsmb/libsmb_file.c @@ -489,7 +489,7 @@ SMBC_getatr(SMBCCTX * context, SMBCSRV *srv, const char *path, uint16 *mode, - SMB_OFF_T *size, + off_t *size, struct timespec *create_time_ts, struct timespec *access_time_ts, struct timespec *write_time_ts, @@ -679,7 +679,7 @@ SMBC_lseek_ctx(SMBCCTX *context, off_t offset, int whence) { - SMB_OFF_T size; + off_t size; char *server = NULL, *share = NULL, *user = NULL, *password = NULL; char *path = NULL; char *targetpath = NULL; @@ -745,7 +745,7 @@ SMBC_lseek_ctx(SMBCCTX *context, targetcli, file->cli_fd, NULL, &size, NULL, NULL, NULL, NULL, NULL))) { - SMB_OFF_T b_size = size; + off_t b_size = size; if (!NT_STATUS_IS_OK(cli_getattrE(targetcli, file->cli_fd, NULL, &b_size, NULL, NULL, NULL))) { errno = EINVAL; @@ -775,7 +775,7 @@ SMBC_ftruncate_ctx(SMBCCTX *context, SMBCFILE *file, off_t length) { - SMB_OFF_T size = length; + off_t size = length; char *server = NULL; char *share = NULL; char *user = NULL; diff --git a/source3/libsmb/libsmb_stat.c b/source3/libsmb/libsmb_stat.c index 30b9291903..2a08b30d70 100644 --- a/source3/libsmb/libsmb_stat.c +++ b/source3/libsmb/libsmb_stat.c @@ -54,7 +54,7 @@ static int setup_stat(SMBCCTX *context, struct stat *st, const char *fname, - SMB_OFF_T size, + off_t size, int mode) { TALLOC_CTX *frame = talloc_stackframe(); @@ -118,7 +118,7 @@ SMBC_stat_ctx(SMBCCTX *context, struct timespec write_time_ts; struct timespec access_time_ts; struct timespec change_time_ts; - SMB_OFF_T size = 0; + off_t size = 0; uint16 mode = 0; SMB_INO_T ino = 0; TALLOC_CTX *frame = talloc_stackframe(); @@ -204,7 +204,7 @@ SMBC_fstat_ctx(SMBCCTX *context, struct timespec change_time_ts; struct timespec access_time_ts; struct timespec write_time_ts; - SMB_OFF_T size; + off_t size; uint16 mode; char *server = NULL; char *share = NULL; diff --git a/source3/libsmb/libsmb_xattr.c b/source3/libsmb/libsmb_xattr.c index 5ed38415bf..199f225975 100644 --- a/source3/libsmb/libsmb_xattr.c +++ b/source3/libsmb/libsmb_xattr.c @@ -556,7 +556,7 @@ dos_attr_query(SMBCCTX *context, struct timespec write_time_ts; struct timespec access_time_ts; struct timespec change_time_ts; - SMB_OFF_T size = 0; + off_t size = 0; uint16 mode = 0; SMB_INO_T inode = 0; DOS_ATTR_DESC *ret; @@ -651,7 +651,7 @@ dos_attr_parse(SMBCCTX *context, } if (strncasecmp_m(tok, "SIZE:", 5) == 0) { - dad->size = (SMB_OFF_T)atof(tok+5); + dad->size = (off_t)atof(tok+5); continue; } @@ -743,7 +743,7 @@ cacl_get(SMBCCTX *context, time_t write_time = (time_t)0; time_t access_time = (time_t)0; time_t change_time = (time_t)0; - SMB_OFF_T size = 0; + off_t size = 0; uint16 mode = 0; SMB_INO_T ino = 0; struct cli_state *cli = srv->cli; diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h index 336c95f07c..735c36aeb6 100644 --- a/source3/libsmb/proto.h +++ b/source3/libsmb/proto.h @@ -465,14 +465,14 @@ struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx, uint16_t fnum); NTSTATUS cli_getattrE_recv(struct tevent_req *req, uint16_t *attr, - SMB_OFF_T *size, + off_t *size, time_t *change_time, time_t *access_time, time_t *write_time); NTSTATUS cli_getattrE(struct cli_state *cli, uint16_t fnum, uint16_t *attr, - SMB_OFF_T *size, + off_t *size, time_t *change_time, time_t *access_time, time_t *write_time); @@ -495,12 +495,12 @@ struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx, const char *fname); NTSTATUS cli_getatr_recv(struct tevent_req *req, uint16_t *attr, - SMB_OFF_T *size, + off_t *size, time_t *write_time); NTSTATUS cli_getatr(struct cli_state *cli, const char *fname, uint16_t *attr, - SMB_OFF_T *size, + off_t *size, time_t *write_time); struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx, struct event_context *ev, @@ -765,15 +765,15 @@ struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx, struct event_context *ev, struct cli_state *cli, uint16_t fnum, off_t start_offset, - SMB_OFF_T size, size_t window_size, + off_t size, size_t window_size, NTSTATUS (*sink)(char *buf, size_t n, void *priv), void *priv); -NTSTATUS cli_pull_recv(struct tevent_req *req, SMB_OFF_T *received); +NTSTATUS cli_pull_recv(struct tevent_req *req, off_t *received); NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum, - off_t start_offset, SMB_OFF_T size, size_t window_size, + off_t start_offset, off_t size, size_t window_size, NTSTATUS (*sink)(char *buf, size_t n, void *priv), - void *priv, SMB_OFF_T *received); + void *priv, off_t *received); NTSTATUS cli_read(struct cli_state *cli, uint16_t fnum, char *buf, off_t offset, size_t size, size_t *nread); -- cgit