]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
Use cpp_strerror() wherever possible, and use autoconf for portability 1672/head
authorDan Mick <dan.mick@inktank.com>
Wed, 9 Apr 2014 04:06:55 +0000 (21:06 -0700)
committerDan Mick <dan.mick@inktank.com>
Mon, 14 Apr 2014 20:07:17 +0000 (13:07 -0700)
commitd0a7632a31258d0963dc5d4cf7502905cc8abfe7
treebe2ae8bfdb53405417d3bd8920abea93298b0045
parent29d83fef77682ad9e1732cbd23c790139199f926
Use cpp_strerror() wherever possible, and use autoconf for portability

strerror_r is not portable; on Gnu libc it returns char * and sometimes
does not fill in the supplied buffer.  Use autoconf to test which
version this platform uses and adapt.

Clean up the random calls to strerror and strerror_r (along with all
their private little one-use buffers) and regularize the code to use
cpp_strerror almost everywhere.  Where changed, any negation of the
error code is also removed, since cpp_strerror() will do that.

Note: some tools were using their own calls to strerror/strerror_r, so
will now get a (%d) in their output that wasn't there before; hence
the change to test/cli/monmaptool/print-nonexistent.t

Fixes: #8041
Signed-off-by: Dan Mick <dan.mick@inktank.com>
32 files changed:
configure.ac
src/ceph_mon.cc
src/cephfs.cc
src/client/SyntheticClient.cc
src/cls/lock/cls_lock.cc
src/cls/rbd/cls_rbd.cc
src/common/Preforker.h
src/common/config.cc
src/common/errno.cc
src/crush/CrushCompiler.cc
src/crush/CrushWrapper.cc
src/erasure-code/ErasureCodePlugin.cc
src/mds/Server.cc
src/messages/MAuthReply.h
src/messages/MClientReply.h
src/messages/MOSDOpReply.h
src/mon/ConfigKeyService.cc
src/mon/DataHealthService.cc
src/mon/MonitorStore.cc
src/mon/MonmapMonitor.cc
src/mon/OSDMonitor.cc
src/msg/Accepter.cc
src/msg/Pipe.cc
src/os/JournalingObjectStore.cc
src/osdc/Objecter.cc
src/test/admin_socket.cc
src/test/cli/monmaptool/print-nonexistent.t
src/tools/ceph_monstore_tool.cc
src/tools/ceph_osdomap_tool.cc
src/tools/crushtool.cc
src/tools/monmaptool.cc
src/tools/rados/rados.cc