summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2010-08-25 16:22:07 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2010-08-25 16:22:33 +0200
commit7764bc0159f4a670293003539e2c8d9cccdcb41a (patch)
tree60d3f296692b043eff30842605a6935d1a54b25d /lib
parent87ca5dda058c8fe6548835b357fad9b93a106045 (diff)
downloadabrt-7764bc0159f4a670293003539e2c8d9cccdcb41a.tar.gz
abrt-7764bc0159f4a670293003539e2c8d9cccdcb41a.tar.xz
abrt-7764bc0159f4a670293003539e2c8d9cccdcb41a.zip
copyfd.cpp -> copyfd.c
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/utils/Makefile.am2
-rw-r--r--lib/utils/copyfd.c (renamed from lib/utils/copyfd.cpp)17
2 files changed, 11 insertions, 8 deletions
diff --git a/lib/utils/Makefile.am b/lib/utils/Makefile.am
index e1b41d65..e5902ec3 100644
--- a/lib/utils/Makefile.am
+++ b/lib/utils/Makefile.am
@@ -16,7 +16,7 @@ libABRTUtils_la_SOURCES = \
encbase64.cpp \
read_write.c read_write.h \
logging.c logging.h \
- copyfd.cpp \
+ copyfd.c \
daemon.cpp \
skip_whitespace.c \
xatonum.cpp numtoa.cpp \
diff --git a/lib/utils/copyfd.cpp b/lib/utils/copyfd.c
index 61acc479..1e6e43b8 100644
--- a/lib/utils/copyfd.cpp
+++ b/lib/utils/copyfd.c
@@ -23,13 +23,14 @@
*/
#include "abrtlib.h"
+#include "read_write.h"
#define CONFIG_FEATURE_COPYBUF_KB 4
static const char msg_write_error[] = "write error";
static const char msg_read_error[] = "read error";
-static off_t full_fd_action(int src_fd, int dst_fd, off_t size, int flags = 0)
+static off_t full_fd_action(int src_fd, int dst_fd, off_t size, int flags)
{
int status = -1;
off_t total = 0;
@@ -97,12 +98,14 @@ static off_t full_fd_action(int src_fd, int dst_fd, off_t size, int flags = 0)
last_was_seek = 1;
} else {
need2write:
- ssize_t wr = full_write(dst_fd, buffer, rd);
- if (wr < rd) {
- perror_msg("%s", msg_write_error);
- break;
- }
- last_was_seek = 0;
+ {
+ ssize_t wr = full_write(dst_fd, buffer, rd);
+ if (wr < rd) {
+ perror_msg("%s", msg_write_error);
+ break;
+ }
+ last_was_seek = 0;
+ }
}
}
total += rd;