Changeset 745 for trunk/server/source3/libsmb/libsmb_compat.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source3/libsmb/libsmb_compat.c
r414 r745 7 7 Copyright (C) Tom Jansen (Ninja ISD) 2002 8 8 Copyright (C) Derrell Lipman 2003, 2008 9 9 10 10 This program is free software; you can redistribute it and/or modify 11 11 it under the terms of the GNU General Public License as published by 12 12 the Free Software Foundation; either version 3 of the License, or 13 13 (at your option) any later version. 14 14 15 15 This program is distributed in the hope that it will be useful, 16 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 18 GNU General Public License for more details. 19 19 20 20 You should have received a copy of the GNU General Public License 21 21 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 56 56 { 57 57 struct smbc_compat_fdlist * f = smbc_compat_fd_avail; 58 58 59 59 if (f) { 60 60 /* We found one that's available */ 61 61 DLIST_REMOVE(smbc_compat_fd_avail, f); 62 63 62 } else { 64 63 /* … … 73 72 return -1; 74 73 } 75 74 76 75 f = SMB_MALLOC_P(struct smbc_compat_fdlist); 77 76 if (!f) { … … 79 78 return -1; 80 79 } 81 80 82 81 f->fd = SMBC_BASE_FD + smbc_compat_nextfd++; 83 82 } 84 83 85 84 f->file = file; 86 85 DLIST_ADD(smbc_compat_fd_in_use, f); 87 86 88 87 return f->fd; 89 88 } … … 96 95 { 97 96 struct smbc_compat_fdlist * f = smbc_compat_fd_in_use; 98 97 99 98 while (f) { 100 99 if (f->fd == fd) … … 102 101 f = f->next; 103 102 } 104 103 105 104 if (f) { 106 105 /* found */ … … 123 122 if (!statcont) 124 123 return -1; 125 124 126 125 smbc_setDebug(statcont, debug); 127 126 smbc_setFunctionAuthData(statcont, fn); 128 127 129 128 if (!smbc_init_context(statcont)) { 130 129 smbc_free_context(statcont, False); 131 130 return -1; 132 131 } 133 132 134 133 smbc_compat_initialized = 1; 135 134 136 135 return 0; 137 136 } … … 144 143 { 145 144 SMBCCTX *old_context = statcont; 146 145 147 146 if (context) { 148 147 /* Save provided context. It must have been initialized! */ 149 148 statcont = context; 150 149 151 150 /* You'd better know what you're doing. We won't help you. */ 152 151 smbc_compat_initialized = 1; 153 152 } 154 153 155 154 return old_context; 156 155 } … … 164 163 SMBCFILE * file; 165 164 int fd; 166 165 167 166 file = smbc_getFunctionOpen(statcont)(statcont, furl, flags, mode); 168 167 if (!file) 169 168 return -1; 170 169 171 170 fd = add_fd(file); 172 171 if (fd == -1) … … 182 181 SMBCFILE * file; 183 182 int fd; 184 183 185 184 file = smbc_getFunctionCreat(statcont)(statcont, furl, mode); 186 185 if (!file) 187 186 return -1; 188 187 189 188 fd = add_fd(file); 190 189 if (fd == -1) { … … 251 250 SMBCFILE * file; 252 251 int fd; 253 252 254 253 file = smbc_getFunctionOpendir(statcont)(statcont, durl); 255 254 if (!file) 256 255 return -1; 257 256 258 257 fd = add_fd(file); 259 258 if (fd == -1) 260 259 smbc_getFunctionClosedir(statcont)(statcont, file); 261 260 262 261 return fd; 263 262 } … … 373 372 { 374 373 struct timeval tv[2]; 375 374 376 375 if (utbuf == NULL) 377 376 return smbc_getFunctionUtimes(statcont)(statcont, fname, NULL); 378 377 379 378 tv[0].tv_sec = utbuf->actime; 380 379 tv[1].tv_sec = utbuf->modtime; 381 380 tv[0].tv_usec = tv[1].tv_usec = 0; 382 381 383 382 return smbc_getFunctionUtimes(statcont)(statcont, fname, tv); 384 383 } … … 535 534 { 536 535 SMBCFILE * file; 537 536 538 537 file = smbc_getFunctionOpenPrintJob(statcont)(statcont, fname); 539 538 if (!file) return -1;
Note:
See TracChangeset
for help on using the changeset viewer.