Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/libsmb/libsmb_compat.c

    r414 r745  
    77   Copyright (C) Tom Jansen (Ninja ISD) 2002
    88   Copyright (C) Derrell Lipman 2003, 2008
    9    
     9
    1010   This program is free software; you can redistribute it and/or modify
    1111   it under the terms of the GNU General Public License as published by
    1212   the Free Software Foundation; either version 3 of the License, or
    1313   (at your option) any later version.
    14    
     14
    1515   This program is distributed in the hope that it will be useful,
    1616   but WITHOUT ANY WARRANTY; without even the implied warranty of
    1717   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1818   GNU General Public License for more details.
    19    
     19
    2020   You should have received a copy of the GNU General Public License
    2121   along with this program.  If not, see <http://www.gnu.org/licenses/>.
     
    5656{
    5757        struct smbc_compat_fdlist * f = smbc_compat_fd_avail;
    58        
     58
    5959        if (f) {
    6060                /* We found one that's available */
    6161                DLIST_REMOVE(smbc_compat_fd_avail, f);
    62                
    6362        } else {
    6463                /*
     
    7372                        return -1;
    7473                }
    75                
     74
    7675                f = SMB_MALLOC_P(struct smbc_compat_fdlist);
    7776                if (!f) {
     
    7978                        return -1;
    8079                }
    81                
     80
    8281                f->fd = SMBC_BASE_FD + smbc_compat_nextfd++;
    8382        }
    84        
     83
    8584        f->file = file;
    8685        DLIST_ADD(smbc_compat_fd_in_use, f);
    87        
     86
    8887        return f->fd;
    8988}
     
    9695{
    9796        struct smbc_compat_fdlist * f = smbc_compat_fd_in_use;
    98        
     97
    9998        while (f) {
    10099                if (f->fd == fd)
     
    102101                f = f->next;
    103102        }
    104        
     103
    105104        if (f) {
    106105                /* found */
     
    123122                if (!statcont)
    124123                        return -1;
    125                
     124
    126125                smbc_setDebug(statcont, debug);
    127126                smbc_setFunctionAuthData(statcont, fn);
    128                
     127
    129128                if (!smbc_init_context(statcont)) {
    130129                        smbc_free_context(statcont, False);
    131130                        return -1;
    132131                }
    133                
     132
    134133                smbc_compat_initialized = 1;
    135                
     134
    136135                return 0;
    137136        }
     
    144143{
    145144        SMBCCTX *old_context = statcont;
    146        
     145
    147146        if (context) {
    148147                /* Save provided context.  It must have been initialized! */
    149148                statcont = context;
    150                
     149
    151150                /* You'd better know what you're doing.  We won't help you. */
    152151                smbc_compat_initialized = 1;
    153152        }
    154        
     153
    155154        return old_context;
    156155}
     
    164163        SMBCFILE * file;
    165164        int fd;
    166        
     165
    167166        file = smbc_getFunctionOpen(statcont)(statcont, furl, flags, mode);
    168167        if (!file)
    169168                return -1;
    170        
     169
    171170        fd = add_fd(file);
    172171        if (fd == -1)
     
    182181        SMBCFILE * file;
    183182        int fd;
    184        
     183
    185184        file = smbc_getFunctionCreat(statcont)(statcont, furl, mode);
    186185        if (!file)
    187186                return -1;
    188        
     187
    189188        fd = add_fd(file);
    190189        if (fd == -1) {
     
    251250        SMBCFILE * file;
    252251        int fd;
    253        
     252
    254253        file = smbc_getFunctionOpendir(statcont)(statcont, durl);
    255254        if (!file)
    256255                return -1;
    257        
     256
    258257        fd = add_fd(file);
    259258        if (fd == -1)
    260259                smbc_getFunctionClosedir(statcont)(statcont, file);
    261        
     260
    262261        return fd;
    263262}
     
    373372{
    374373        struct timeval tv[2];
    375        
     374
    376375        if (utbuf == NULL)
    377376                return smbc_getFunctionUtimes(statcont)(statcont, fname, NULL);
    378        
     377
    379378        tv[0].tv_sec = utbuf->actime;
    380379        tv[1].tv_sec = utbuf->modtime;
    381380        tv[0].tv_usec = tv[1].tv_usec = 0;
    382        
     381
    383382        return smbc_getFunctionUtimes(statcont)(statcont, fname, tv);
    384383}
     
    535534{
    536535        SMBCFILE * file;
    537        
     536
    538537        file = smbc_getFunctionOpenPrintJob(statcont)(statcont, fname);
    539538        if (!file) return -1;
Note: See TracChangeset for help on using the changeset viewer.