This is an automated email from the ASF dual-hosted git repository. jamesge pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git
The following commit(s) were added to refs/heads/master by this push: new 01d8160 add license to file that missing it new 869b27c Merge pull request #929 from zyearn/fix_license 01d8160 is described below commit 01d81608c108adfc69dd259692944107529ea1d7 Author: zhujiashun <zhujiashun2...@gmail.com> AuthorDate: Sun Sep 22 18:34:11 2019 +0800 add license to file that missing it --- LICENSE | 34 ++++++++++++++++++ src/brpc/callback.h | 34 ++++++++++++++++++ src/brpc/details/tcmalloc_extension.cpp | 17 +++++++++ src/butil/file_util_linux.cc | 27 ++++++++++---- src/butil/linux_magic.h | 62 --------------------------------- src/butil/recordio.cc | 17 +++++++++ src/butil/unique_ptr.h | 22 ++++++------ 7 files changed, 134 insertions(+), 79 deletions(-) diff --git a/LICENSE b/LICENSE index 8fb8509..971e38b 100644 --- a/LICENSE +++ b/LICENSE @@ -657,6 +657,40 @@ src/brpc/builtin/flamegraph_perl.cpp: licensed under the following terms: -------------------------------------------------------------------------------- +src/brpc/callback.h: 3-clause BSD + + Protocol Buffers - Google's data interchange format + Copyright 2008 Google Inc. All rights reserved. + http://code.google.com/p/protobuf/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------------------- + src/butil (some portions): 3-clause BSD Some portions of this module are derived from code in the Chromium project, diff --git a/src/brpc/callback.h b/src/brpc/callback.h index dd36bd1..739278e 100644 --- a/src/brpc/callback.h +++ b/src/brpc/callback.h @@ -1,3 +1,37 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// http://code.google.com/p/protobuf/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: ken...@google.com (Kenton Varda) and others +// +// Contains basic types and utilities used by the rest of the library. + // The code in this file is modified from google/protobuf/stubs/common.h // in protobuf-2.4, mainly for creating closures. We need to separate // the code because protobuf 3.0 moves NewCallback into internal namespace. diff --git a/src/brpc/details/tcmalloc_extension.cpp b/src/brpc/details/tcmalloc_extension.cpp index 37a123e..53df209 100644 --- a/src/brpc/details/tcmalloc_extension.cpp +++ b/src/brpc/details/tcmalloc_extension.cpp @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + #include <pthread.h> #include <dlfcn.h> // dlsym #include <stdlib.h> // getenv diff --git a/src/butil/file_util_linux.cc b/src/butil/file_util_linux.cc index d6ce586..8ea69fe 100644 --- a/src/butil/file_util_linux.cc +++ b/src/butil/file_util_linux.cc @@ -5,16 +5,31 @@ #include "butil/file_util.h" #include <errno.h> -// NOTE(gejun): Missing linux/magic.h in some machines of Baidu. Since the file -// only contains macro constants which is unlikely to be changed in future, we -// copy the header locally. -#include "butil/linux_magic.h" #include <sys/vfs.h> #include "butil/files/file_path.h" -// Make sure some of the newer macros from magic.h are defined. -// TODO(most...@opera.com): remove this after 2014. +#ifndef EXT2_SUPER_MAGIC +#define EXT2_SUPER_MAGIC 0xEF53 +#endif +#ifndef MSDOS_SUPER_MAGIC +#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ +#endif +#ifndef REISERFS_SUPER_MAGIC +#define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */ +#endif +#ifndef NFS_SUPER_MAGIC +#define NFS_SUPER_MAGIC 0x6969 +#endif +#ifndef SMB_SUPER_MAGIC +#define SMB_SUPER_MAGIC 0x517B +#endif +#ifndef CODA_SUPER_MAGIC +#define CODA_SUPER_MAGIC 0x73757245 +#endif +#ifndef CGROUP_SUPER_MAGIC +#define CGROUP_SUPER_MAGIC 0x27e0eb +#endif #ifndef BTRFS_SUPER_MAGIC #define BTRFS_SUPER_MAGIC 0x9123683E #endif diff --git a/src/butil/linux_magic.h b/src/butil/linux_magic.h deleted file mode 100644 index de585f9..0000000 --- a/src/butil/linux_magic.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef BUTIL_LINUX_MAGIC_H -#define BUTIL_LINUX_MAGIC_H - -#define ADFS_SUPER_MAGIC 0xadf5 -#define AFFS_SUPER_MAGIC 0xadff -#define AFS_SUPER_MAGIC 0x5346414F -#define AUTOFS_SUPER_MAGIC 0x0187 -#define CODA_SUPER_MAGIC 0x73757245 -#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */ -#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */ -#define DEBUGFS_MAGIC 0x64626720 -#define SYSFS_MAGIC 0x62656572 -#define SECURITYFS_MAGIC 0x73636673 -#define SELINUX_MAGIC 0xf97cff8c -#define RAMFS_MAGIC 0x858458f6 /* some random number */ -#define TMPFS_MAGIC 0x01021994 -#define HUGETLBFS_MAGIC 0x958458f6 /* some random number */ -#define SQUASHFS_MAGIC 0x73717368 -#define EFS_SUPER_MAGIC 0x414A53 -#define EXT2_SUPER_MAGIC 0xEF53 -#define EXT3_SUPER_MAGIC 0xEF53 -#define XENFS_SUPER_MAGIC 0xabba1974 -#define EXT4_SUPER_MAGIC 0xEF53 -#define BTRFS_SUPER_MAGIC 0x9123683E -#define HPFS_SUPER_MAGIC 0xf995e849 -#define ISOFS_SUPER_MAGIC 0x9660 -#define JFFS2_SUPER_MAGIC 0x72b6 -#define ANON_INODE_FS_MAGIC 0x09041934 - -#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ -#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ -#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ -#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ -#define MINIX3_SUPER_MAGIC 0x4d5a /* minix V3 fs */ - -#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ -#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */ -#define NFS_SUPER_MAGIC 0x6969 -#define OPENPROM_SUPER_MAGIC 0x9fa1 -#define PROC_SUPER_MAGIC 0x9fa0 -#define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */ - -#define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */ - /* used by file system utilities that - look at the superblock, etc. */ -#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs" -#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs" -#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs" - -#define SMB_SUPER_MAGIC 0x517B -#define USBDEVICE_SUPER_MAGIC 0x9fa2 -#define CGROUP_SUPER_MAGIC 0x27e0eb - -#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA -#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA - -#define STACK_END_MAGIC 0x57AC6E9D - -#define DEVPTS_SUPER_MAGIC 0x1cd1 -#define SOCKFS_MAGIC 0x534F434B - -#endif /* BUTIL_LINUX_MAGIC_H */ diff --git a/src/butil/recordio.cc b/src/butil/recordio.cc index 12befac..3362e5c 100755 --- a/src/butil/recordio.cc +++ b/src/butil/recordio.cc @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + #include <gflags/gflags.h> #include "butil/logging.h" #include "butil/recordio.h" diff --git a/src/butil/unique_ptr.h b/src/butil/unique_ptr.h index 5be9c34..4fa44b8 100644 --- a/src/butil/unique_ptr.h +++ b/src/butil/unique_ptr.h @@ -1,14 +1,3 @@ -#ifndef BUTIL_UNIQUE_PTR_H -#define BUTIL_UNIQUE_PTR_H - -#include "butil/build_config.h" - -#if defined(BUTIL_CXX11_ENABLED) - -#include <memory> // std::unique_ptr - -#elif !defined(BAIDU_NO_EMULATED_UNIQUE_PTR) - // Copyright 2009 Howard Hinnant, Ion Gaztañaga. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -21,6 +10,17 @@ // reference http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html // for any pending issues against this specification. +#ifndef BUTIL_UNIQUE_PTR_H +#define BUTIL_UNIQUE_PTR_H + +#include "butil/build_config.h" + +#if defined(BUTIL_CXX11_ENABLED) + +#include <memory> // std::unique_ptr + +#elif !defined(BAIDU_NO_EMULATED_UNIQUE_PTR) + #include <algorithm> // std::swap until C++11 #include "butil/type_traits.h" #include "butil/macros.h" // BAIDU_CASSERT --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org