diff options
author | Peter Wemm <peter@FreeBSD.org> | 2014-05-27 04:55:31 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 2014-05-27 04:55:31 +0000 |
commit | 41a48a0a1803245a188068c5200383b9543c25b2 (patch) | |
tree | 6d1265a766b5c11e4c2414a994dbabb861526c73 /subversion/libsvn_subr | |
parent | 219f5ebf8fca3572d8d4265d78d0e4670ca35a27 (diff) |
Notes
Diffstat (limited to 'subversion/libsvn_subr')
-rw-r--r-- | subversion/libsvn_subr/cache-memcache.c | 7 | ||||
-rw-r--r-- | subversion/libsvn_subr/config_file.c | 2 | ||||
-rw-r--r-- | subversion/libsvn_subr/internal_statements.h | 2 | ||||
-rw-r--r-- | subversion/libsvn_subr/io.c | 38 | ||||
-rw-r--r-- | subversion/libsvn_subr/prompt.c | 2 | ||||
-rw-r--r-- | subversion/libsvn_subr/sysinfo.c | 1 | ||||
-rw-r--r-- | subversion/libsvn_subr/version.c | 2 |
7 files changed, 34 insertions, 20 deletions
diff --git a/subversion/libsvn_subr/cache-memcache.c b/subversion/libsvn_subr/cache-memcache.c index 5332d04428e31..500426d0ff1ca 100644 --- a/subversion/libsvn_subr/cache-memcache.c +++ b/subversion/libsvn_subr/cache-memcache.c @@ -203,9 +203,10 @@ memcache_get(void **value_p, } else { - svn_string_t *value = apr_pcalloc(result_pool, sizeof(*value)); + svn_stringbuf_t *value = svn_stringbuf_create_empty(result_pool); value->data = data; - value->len = data_len; + value->blocksize = data_len; + value->len = data_len - 1; /* account for trailing NUL */ *value_p = value; } } @@ -263,7 +264,7 @@ memcache_set(void *cache_void, { svn_stringbuf_t *value_str = value; data = value_str->data; - data_len = value_str->len; + data_len = value_str->len + 1; /* copy trailing NUL */ } err = memcache_internal_set(cache_void, key, data, data_len, subpool); diff --git a/subversion/libsvn_subr/config_file.c b/subversion/libsvn_subr/config_file.c index c705b14fd40a9..9969b8eb97001 100644 --- a/subversion/libsvn_subr/config_file.c +++ b/subversion/libsvn_subr/config_file.c @@ -69,7 +69,7 @@ typedef struct parse_context_t /* Parser buffer for getc() to avoid call overhead into several libraries for every character */ - char parser_buffer[SVN_STREAM_CHUNK_SIZE]; /* Larger than most config files */ + char parser_buffer[SVN__STREAM_CHUNK_SIZE]; /* Larger than most config files */ size_t buffer_pos; /* Current position within parser_buffer */ size_t buffer_size; /* parser_buffer contains this many bytes */ } parse_context_t; diff --git a/subversion/libsvn_subr/internal_statements.h b/subversion/libsvn_subr/internal_statements.h index 84c616f38bee5..4fa938932ecca 100644 --- a/subversion/libsvn_subr/internal_statements.h +++ b/subversion/libsvn_subr/internal_statements.h @@ -1,4 +1,4 @@ -/* This file is automatically generated from internal_statements.sql and .dist_sandbox/subversion-1.8.8/subversion/libsvn_subr/token-map.h. +/* This file is automatically generated from internal_statements.sql and .dist_sandbox/subversion-1.8.9/subversion/libsvn_subr/token-map.h. * Do not edit this file -- edit the source and rerun gen-make.py */ #define STMT_INTERNAL_SAVEPOINT_SVN 0 diff --git a/subversion/libsvn_subr/io.c b/subversion/libsvn_subr/io.c index f0956e2aa8e94..08f2e326d7fe6 100644 --- a/subversion/libsvn_subr/io.c +++ b/subversion/libsvn_subr/io.c @@ -1243,32 +1243,44 @@ svn_io_sleep_for_timestamps(const char *path, apr_pool_t *pool) { /* Very simplistic but safe approach: If the filesystem has < sec mtime we can be reasonably sure - that the filesystem has <= millisecond precision. + that the filesystem has some sub-second resolution. On Windows + it is likely to be sub-millisecond; on Linux systems it depends + on the filesystem, ext4 is typically 1ms, 4ms or 10ms resolution. ## Perhaps find a better algorithm here. This will fail once - in every 1000 cases on a millisecond precision filesystem. + in every 1000 cases on a millisecond precision filesystem + if the mtime happens to be an exact second. But better to fail once in every thousand cases than every time, like we did before. - (All tested filesystems I know have at least microsecond precision.) Note for further research on algorithm: - FAT32 has < 1 sec precision on ctime, but 2 sec on mtime */ + FAT32 has < 1 sec precision on ctime, but 2 sec on mtime. - /* Sleep for at least 1 millisecond. - (t < 1000 will be round to 0 in apr) */ - apr_sleep(1000); + Linux/ext4 with CONFIG_HZ=250 has high resolution + apr_time_now and although the filesystem timestamps + have similar high precision they are only updated with + a coarser 4ms resolution. */ - return; + /* 10 milliseconds after now. */ +#ifndef SVN_HI_RES_SLEEP_MS +#define SVN_HI_RES_SLEEP_MS 10 +#endif + then = now + apr_time_from_msec(SVN_HI_RES_SLEEP_MS); } - now = apr_time_now(); /* Extract the time used for the path stat */ - - if (now >= then) - return; /* Passing negative values may suspend indefinitely (Windows) */ + /* Remove time taken to do stat() from sleep. */ + now = apr_time_now(); } - apr_sleep(then - now); + if (now >= then) + return; /* Passing negative values may suspend indefinitely (Windows) */ + + /* (t < 1000 will be round to 0 in apr) */ + if (then - now < 1000) + apr_sleep(1000); + else + apr_sleep(then - now); } diff --git a/subversion/libsvn_subr/prompt.c b/subversion/libsvn_subr/prompt.c index 92ee6a27888a2..d0c29d025cb38 100644 --- a/subversion/libsvn_subr/prompt.c +++ b/subversion/libsvn_subr/prompt.c @@ -177,7 +177,7 @@ terminal_open(terminal_handle_t **terminal, svn_boolean_t noecho, and stderr for prompting. */ apr_file_t *tmpfd; status = apr_file_open(&tmpfd, "/dev/tty", - APR_FOPEN_READ | APR_FOPEN_WRITE, + APR_READ | APR_WRITE, APR_OS_DEFAULT, pool); *terminal = apr_palloc(pool, sizeof(terminal_handle_t)); if (!status) diff --git a/subversion/libsvn_subr/sysinfo.c b/subversion/libsvn_subr/sysinfo.c index a506310aa9069..f20050cdb014c 100644 --- a/subversion/libsvn_subr/sysinfo.c +++ b/subversion/libsvn_subr/sysinfo.c @@ -1022,6 +1022,7 @@ release_name_from_version(const char *osver) case 6: return "Snow Leopard"; case 7: return "Lion"; case 8: return "Mountain Lion"; + case 9: return "Mavericks"; } return NULL; diff --git a/subversion/libsvn_subr/version.c b/subversion/libsvn_subr/version.c index 03dc83b8ca058..0859489f44c53 100644 --- a/subversion/libsvn_subr/version.c +++ b/subversion/libsvn_subr/version.c @@ -136,7 +136,7 @@ svn_version_extended(svn_boolean_t verbose, info->build_time = __TIME__; info->build_host = SVN_BUILD_HOST; info->copyright = apr_pstrdup - (pool, _("Copyright (C) 2013 The Apache Software Foundation.\n" + (pool, _("Copyright (C) 2014 The Apache Software Foundation.\n" "This software consists of contributions made by many people;\n" "see the NOTICE file for more information.\n" "Subversion is open source software, see " |