Ignore:
Timestamp:
May 20, 2009, 6:46:53 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.4

Location:
branches/samba-3.2.x/source/lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/lib/interface.c

    r141 r204  
    132132
    133133/****************************************************************************
    134  How many interfaces do we have (v4 only) ?
    135 **************************************************************************/
    136 
    137 int iface_count_v4(void)
     134 How many non-loopback IPv4 interfaces do we have ?
     135**************************************************************************/
     136
     137int iface_count_v4_nl(void)
    138138{
    139139        int ret = 0;
     
    141141
    142142        for (i=local_interfaces;i;i=i->next) {
     143                if (is_loopback_addr(&i->ip)) {
     144                        continue;
     145                }
    143146                if (i->ip.ss_family == AF_INET) {
    144147                        ret++;
  • branches/samba-3.2.x/source/lib/tdb/common/io.c

    r133 r204  
    208208#ifdef HAVE_MMAP
    209209        if (tdb->map_ptr) {
    210                 int ret = munmap(tdb->map_ptr, tdb->map_size);
     210                int ret;
     211
     212                ret = munmap(tdb->map_ptr, tdb->map_size);
    211213                if (ret != 0)
    212214                        return ret;
  • branches/samba-3.2.x/source/lib/tdb/common/transaction.c

    r133 r204  
    569569                return -1;
    570570        }
    571 #ifdef MS_SYNC
     571#ifdef HAVE_MMAP
    572572        if (tdb->map_ptr) {
    573573                tdb_off_t moffset = offset & ~(tdb->page_size-1);
  • branches/samba-3.2.x/source/lib/time.c

    r138 r204  
    827827****************************************************************************/
    828828
    829 time_t get_create_time(const SMB_STRUCT_STAT *st,bool fake_dirs)
     829static time_t calc_create_time(const SMB_STRUCT_STAT *st)
    830830{
    831831        time_t ret, ret1;
    832832
    833         if(S_ISDIR(st->st_mode) && fake_dirs) {
    834                 return (time_t)315493200L;          /* 1/1/1980 */
    835         }
    836    
    837833        ret = MIN(st->st_ctime, st->st_mtime);
    838834        ret1 = MIN(ret, st->st_atime);
     
    849845}
    850846
    851 struct timespec get_create_timespec(const SMB_STRUCT_STAT *st,bool fake_dirs)
    852 {
    853         struct timespec ts;
    854         ts.tv_sec = get_create_time(st, fake_dirs);
    855         ts.tv_nsec = 0;
    856         return ts;
     847/****************************************************************************
     848 Return the 'create time' from a stat struct if it exists (birthtime) or else
     849 use the best approximation.
     850****************************************************************************/
     851
     852struct timespec get_create_timespec(const SMB_STRUCT_STAT *pst,bool fake_dirs)
     853{
     854        struct timespec ret;
     855
     856        if(S_ISDIR(pst->st_mode) && fake_dirs) {
     857                ret.tv_sec = 315493200L;          /* 1/1/1980 */
     858                ret.tv_nsec = 0;
     859                return ret;
     860        }
     861
     862#if defined(HAVE_STAT_ST_BIRTHTIMESPEC)
     863        ret = pst->st_birthtimespec;
     864#elif defined(HAVE_STAT_ST_BIRTHTIMENSEC)
     865        ret.tv_sec = pst->st_birthtime;
     866        ret.tv_nsec = pst->st_birthtimenspec;
     867#elif defined(HAVE_STAT_ST_BIRTHTIME)
     868        ret.tv_sec = pst->st_birthtime;
     869        ret.tv_nsec = 0;
     870#else
     871        ret.tv_sec = calc_create_time(pst);
     872        ret.tv_nsec = 0;
     873#endif
     874
     875        /* Deal with systems that don't initialize birthtime correctly.
     876         * Pointed out by SATOH Fumiyasu <fumiyas@osstech.jp>.
     877         */
     878        if (null_timespec(ret)) {
     879                ret.tv_sec = calc_create_time(pst);
     880                ret.tv_nsec = 0;
     881        }
     882        return ret;
    857883}
    858884
  • branches/samba-3.2.x/source/lib/util_sock.c

    r141 r204  
    13801380}
    13811381
    1382 /****************************************************************************
    1383  Create an outgoing TCP socket to any of the addrs. This is for
    1384  simultaneous connects to port 445 and 139 of a host or even a variety
    1385  of DC's all of which are equivalent for our purposes.
    1386 **************************************************************************/
     1382/*******************************************************************
     1383 Create an outgoing TCP socket to the first addr that connects.
     1384
     1385 This is for simultaneous connection attempts to port 445 and 139 of a host
     1386 or for simultatneous connection attempts to multiple DCs at once.  We return
     1387 a socket fd of the first successful connection.
     1388
     1389 @param[in] addrs list of Internet addresses and ports to connect to
     1390 @param[in] num_addrs number of address/port pairs in the addrs list
     1391 @param[in] timeout time after which we stop waiting for a socket connection
     1392            to succeed, given in milliseconds
     1393 @param[out] fd_index the entry in addrs which we successfully connected to
     1394 @param[out] fd fd of the open and connected socket
     1395 @return true on a successful connection, false if all connection attempts
     1396         failed or we timed out
     1397*******************************************************************/
    13871398
    13881399bool open_any_socket_out(struct sockaddr_storage *addrs, int num_addrs,
  • branches/samba-3.2.x/source/lib/util_str.c

    r141 r204  
    20072007bool str_list_substitute(char **list, const char *pattern, const char *insert)
    20082008{
     2009        TALLOC_CTX *ctx = list;
    20092010        char *p, *s, *t;
    20102011        ssize_t ls, lp, li, ld, i, d;
     
    20292030                        d = p -t;
    20302031                        if (ld) {
    2031                                 t = (char *) SMB_MALLOC(ls +ld +1);
     2032                                t = TALLOC_ARRAY(ctx, char, ls +ld +1);
    20322033                                if (!t) {
    20332034                                        DEBUG(0,("str_list_substitute: "
     
    20372038                                memcpy(t, *list, d);
    20382039                                memcpy(t +d +li, p +lp, ls -d -lp +1);
    2039                                 SAFE_FREE(*list);
     2040                                TALLOC_FREE(*list);
    20402041                                *list = t;
    20412042                                ls += ld;
Note: See TracChangeset for help on using the changeset viewer.