mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-26 09:47:58 +00:00
Merge pull request #6934 from ThomasWaldmann/fix-warnings-master
Fix warnings (master)
This commit is contained in:
commit
99c72c5f75
4 changed files with 36 additions and 6 deletions
|
@ -154,8 +154,6 @@ static int
|
|||
chunker_fill(Chunker *c)
|
||||
{
|
||||
ssize_t n;
|
||||
off_t offset, length;
|
||||
int overshoot;
|
||||
PyObject *data;
|
||||
PyThreadState *thread_state;
|
||||
|
||||
|
@ -169,7 +167,10 @@ chunker_fill(Chunker *c)
|
|||
if(c->fh >= 0) {
|
||||
thread_state = PyEval_SaveThread();
|
||||
|
||||
offset = c->bytes_read;
|
||||
#if ( ( _XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L ) && defined(POSIX_FADV_DONTNEED) )
|
||||
off_t offset = c->bytes_read;
|
||||
#endif
|
||||
|
||||
// if we have a os-level file descriptor, use os-level API
|
||||
n = read(c->fh, c->data + c->position + c->remaining, n);
|
||||
if(n > 0) {
|
||||
|
@ -186,8 +187,8 @@ chunker_fill(Chunker *c)
|
|||
PyErr_SetFromErrno(PyExc_OSError);
|
||||
return 0;
|
||||
}
|
||||
length = c->bytes_read - offset;
|
||||
#if ( ( _XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L ) && defined(POSIX_FADV_DONTNEED) )
|
||||
off_t length = c->bytes_read - offset;
|
||||
|
||||
// Only do it once per run.
|
||||
if (pagemask == 0)
|
||||
|
@ -200,6 +201,7 @@ chunker_fill(Chunker *c)
|
|||
// for the OS or other processes.
|
||||
// We rollback the initial offset back to the start of the page,
|
||||
// to avoid it not being truncated as a partial page request.
|
||||
int overshoot;
|
||||
if (length > 0) {
|
||||
// All Linux kernels (at least up to and including 4.6(.0)) have a bug where
|
||||
// they truncate last partial page of POSIX_FADV_DONTNEED request, so we need
|
||||
|
|
23
src/borg/cache_sync/__init__.py
Normal file
23
src/borg/cache_sync/__init__.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
"""
|
||||
dummy package init file to suppress this weird setuptools warning:
|
||||
|
||||
$ pip install -v . # note: does not happen with -ve .
|
||||
|
||||
############################
|
||||
# Package would be ignored #
|
||||
############################
|
||||
Python recognizes 'borg.cache_sync' as an importable package,
|
||||
but it is not listed in the `packages` configuration of setuptools.
|
||||
|
||||
'borg.cache_sync' has been automatically added to the distribution only
|
||||
because it may contain data files, but this behavior is likely to change
|
||||
in future versions of setuptools (and therefore is considered deprecated).
|
||||
|
||||
Please make sure that 'borg.cache_sync' is included as a package by using
|
||||
the `packages` configuration field or the proper discovery methods
|
||||
(for example by using `find_namespace_packages(...)`/`find_namespace:`
|
||||
instead of `find_packages(...)`/`find:`).
|
||||
|
||||
You can read more about "package discovery" and "data files" on setuptools
|
||||
documentation page.
|
||||
"""
|
|
@ -388,6 +388,11 @@ static inline int unpack_callback_raw(unpack_user* u, const char* b, const char*
|
|||
u->expect = expect_map_item_end;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if(u->inside_chunks) {
|
||||
SET_LAST_ERROR("Unexpected raw in chunks structure");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -278,8 +278,8 @@ cdef class NSKeyIterator:
|
|||
cdef const unsigned char *key
|
||||
cdef int key_size
|
||||
cdef int exhausted
|
||||
cdef int flag_mask
|
||||
cdef int flag_value
|
||||
cdef unsigned int flag_mask
|
||||
cdef unsigned int flag_value
|
||||
|
||||
def __cinit__(self, key_size, mask, value):
|
||||
self.key = NULL
|
||||
|
|
Loading…
Reference in a new issue