diff options
author | Karel Klic <kklic@redhat.com> | 2010-08-24 12:32:13 +0200 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2010-08-24 12:32:13 +0200 |
commit | a123d0363253f734156b515d03774a71ff089f29 (patch) | |
tree | 45331ab22b1f8139def09aeeb3db928cc2d5f63f | |
parent | 005335f3cc5f4883ee6327aede7eaae91688ca78 (diff) | |
parent | d19af002e83237b5f8b67eae171a008c9bd3ccc5 (diff) | |
download | abrt-a123d0363253f734156b515d03774a71ff089f29.tar.gz abrt-a123d0363253f734156b515d03774a71ff089f29.tar.xz abrt-a123d0363253f734156b515d03774a71ff089f29.zip |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
-rw-r--r-- | inc/abrt_types.h | 4 | ||||
-rw-r--r-- | inc/abrtlib.h | 10 | ||||
-rw-r--r-- | lib/utils/copyfd.cpp | 4 |
3 files changed, 13 insertions, 5 deletions
diff --git a/inc/abrt_types.h b/inc/abrt_types.h index ae22b03d..38804895 100644 --- a/inc/abrt_types.h +++ b/inc/abrt_types.h @@ -19,6 +19,8 @@ #ifndef ABRT_TYPES_H_ #define ABRT_TYPES_H_ +#ifdef __cplusplus + #include <map> #include <set> #include <vector> @@ -43,4 +45,6 @@ typedef map_vector_string_t report_status_t; /* Holds result of .conf file section parsing: map["name"] = "value" */ typedef map_string_t map_plugin_settings_t; +#endif /* __cplusplus */ + #endif diff --git a/inc/abrtlib.h b/inc/abrtlib.h index 713694b8..f38374e3 100644 --- a/inc/abrtlib.h +++ b/inc/abrtlib.h @@ -38,7 +38,9 @@ #include <pwd.h> #include <grp.h> /* C++ bits */ -#include <string> +#ifdef __cplusplus +# include <string> +#endif /* Some libc's forget to declare these, do it ourself */ extern char **environ; @@ -93,8 +95,8 @@ int xatoi_u(const char *numstr); enum { COPYFD_SPARSE = 1 << 0, }; -off_t copyfd_eof(int src_fd, int dst_fd, int flags = 0); -off_t copyfd_size(int src_fd, int dst_fd, off_t size, int flags = 0); +off_t copyfd_eof(int src_fd, int dst_fd, int flags); +off_t copyfd_size(int src_fd, int dst_fd, off_t size, int flags); void copyfd_exact_size(int src_fd, int dst_fd, off_t size); off_t copy_file(const char *src_name, const char *dst_name, int mode); @@ -183,6 +185,7 @@ int daemon_is_ok(); char *encode_base64(const void *src, int length); /* C++ style stuff */ +#ifdef __cplusplus double get_dirsize(const char *pPath); double get_dirsize_find_largest_dir( const char *pPath, @@ -201,6 +204,7 @@ std::string to_string(T x) void parse_args(const char *psArgs, vector_string_t& pArgs, int quote = -1); void parse_release(const char *pRelease, char **product, char **version); +#endif // TODO: npajkovs: full rewrite ssprintf -> xasprintf static inline std::string ssprintf(const char *format, ...) diff --git a/lib/utils/copyfd.cpp b/lib/utils/copyfd.cpp index cbcf7005..61acc479 100644 --- a/lib/utils/copyfd.cpp +++ b/lib/utils/copyfd.cpp @@ -134,7 +134,7 @@ off_t copyfd_size(int fd1, int fd2, off_t size, int flags) void copyfd_exact_size(int fd1, int fd2, off_t size) { - off_t sz = copyfd_size(fd1, fd2, size); + off_t sz = copyfd_size(fd1, fd2, size, /*flags:*/ 0); if (sz == size) return; if (sz != -1) @@ -164,7 +164,7 @@ off_t copy_file(const char *src_name, const char *dst_name, int mode) perror_msg("Can't open '%s'", dst_name); return -1; } - r = copyfd_eof(src, dst); + r = copyfd_eof(src, dst, /*flags:*/ 0); close(src); close(dst); return r; |