Changeset 751 for trunk/server/source3/modules/vfs_default.c
- Timestamp:
- Nov 29, 2012, 1:59:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/modules/vfs_default.c
r745 r751 1045 1045 1046 1046 #ifdef HAVE_KERNEL_OPLOCKS_LINUX 1047 /* first set the signal handler */1048 if(linux_set_lease_sighandler(fsp->fh->fd) == -1) {1049 return -1;1050 }1051 1052 1047 result = linux_setlease(fsp->fh->fd, leasetype); 1053 1048 #else … … 1183 1178 { 1184 1179 SMB_STRUCT_STAT sbuf; 1185 unsigned int num_streams = 0; 1186 struct stream_struct *streams = NULL; 1180 struct stream_struct *tmp_streams = NULL; 1187 1181 int ret; 1188 1182 … … 1219 1213 } 1220 1214 1221 streams = talloc(mem_ctx, struct stream_struct);1222 1223 if ( streams == NULL) {1215 tmp_streams = talloc_realloc(mem_ctx, *pstreams, struct stream_struct, 1216 (*pnum_streams) + 1); 1217 if (tmp_streams == NULL) { 1224 1218 return NT_STATUS_NO_MEMORY; 1225 1219 } 1226 1227 streams->size = sbuf.st_ex_size; 1228 streams->alloc_size = SMB_VFS_GET_ALLOC_SIZE(handle->conn, fsp, &sbuf); 1229 1230 streams->name = talloc_strdup(streams, "::$DATA"); 1231 if (streams->name == NULL) { 1232 TALLOC_FREE(streams); 1220 tmp_streams[*pnum_streams].name = talloc_strdup(tmp_streams, "::$DATA"); 1221 if (tmp_streams[*pnum_streams].name == NULL) { 1233 1222 return NT_STATUS_NO_MEMORY; 1234 1223 } 1235 1236 num_streams = 1; 1224 tmp_streams[*pnum_streams].size = sbuf.st_ex_size; 1225 tmp_streams[*pnum_streams].alloc_size = SMB_VFS_GET_ALLOC_SIZE(handle->conn, fsp, &sbuf); 1226 1227 *pnum_streams += 1; 1228 *pstreams = tmp_streams; 1237 1229 done: 1238 *pnum_streams = num_streams;1239 *pstreams = streams;1240 1230 return NT_STATUS_OK; 1241 1231 }
Note:
See TracChangeset
for help on using the changeset viewer.