Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-04-29 19:29:44 +0000
committereutarass2011-04-29 19:29:44 +0000
commit69507c4a7d05f140376c2566ba9418cf27909530 (patch)
tree1694fee38011184289efd060963802fe8d7ebdb4
parent957735abf60d39529fd82e11b3f999802cd76780 (diff)
downloadorg.eclipse.tcf.agent-69507c4a7d05f140376c2566ba9418cf27909530.tar.gz
org.eclipse.tcf.agent-69507c4a7d05f140376c2566ba9418cf27909530.tar.xz
org.eclipse.tcf.agent-69507c4a7d05f140376c2566ba9418cf27909530.zip
Bug 339595 - Changes necessary for VxWorks 6.9 targets (add #include <string.h> and use ssize_t)
-rw-r--r--framework/cache.c1
-rw-r--r--framework/channel.c5
-rw-r--r--framework/channel_pipe.c4
-rw-r--r--framework/channel_tcp.c11
-rw-r--r--framework/errors.c2
-rw-r--r--framework/events.c1
-rw-r--r--framework/ip_ifc.c1
-rw-r--r--framework/json.c1
-rw-r--r--framework/mdep.c2
-rw-r--r--framework/peer.c1
-rw-r--r--framework/streams.c1
-rw-r--r--framework/streams.h2
-rw-r--r--framework/trace.c1
-rw-r--r--services/diagnostics.c1
-rw-r--r--services/discovery.c1
-rw-r--r--services/discovery_udp.c5
-rw-r--r--services/streamsservice.c7
17 files changed, 31 insertions, 16 deletions
diff --git a/framework/cache.c b/framework/cache.c
index a1cbfafc..585462e9 100644
--- a/framework/cache.c
+++ b/framework/cache.c
@@ -18,6 +18,7 @@
#include <config.h>
#include <assert.h>
+#include <string.h>
#include <framework/errors.h>
#include <framework/exceptions.h>
#include <framework/myalloc.h>
diff --git a/framework/channel.c b/framework/channel.c
index e74ba2e5..8f499b56 100644
--- a/framework/channel.c
+++ b/framework/channel.c
@@ -24,6 +24,7 @@
#include <errno.h>
#include <assert.h>
#include <ctype.h>
+#include <string.h>
#include <framework/tcf.h>
#include <framework/channel.h>
#include <framework/channel_tcp.h>
@@ -74,9 +75,9 @@ static void write_block_all(OutputStream * out, const char * bytes, size_t size)
}
}
-static int splice_block_all(OutputStream * out, int fd, size_t size, off_t * offset) {
+static ssize_t splice_block_all(OutputStream * out, int fd, size_t size, off_t * offset) {
char buffer[0x400];
- int rd = 0;
+ ssize_t rd = 0;
assert(is_dispatch_thread());
if (size > sizeof(buffer)) size = sizeof(buffer);
diff --git a/framework/channel_pipe.c b/framework/channel_pipe.c
index b625a1f6..d2fe3c20 100644
--- a/framework/channel_pipe.c
+++ b/framework/channel_pipe.c
@@ -258,8 +258,8 @@ static void pipe_write_block_stream(OutputStream * out, const char * bytes, size
while (cnt < size) write_stream(out, (unsigned char)bytes[cnt++]);
}
-static int pipe_splice_block_stream(OutputStream * out, int fd, size_t size, off_t * offset) {
- int rd = 0;
+static ssize_t pipe_splice_block_stream(OutputStream * out, int fd, size_t size, off_t * offset) {
+ ssize_t rd = 0;
char buffer[BUF_SIZE];
assert(is_dispatch_thread());
if (size == 0) return 0;
diff --git a/framework/channel_tcp.c b/framework/channel_tcp.c
index 748a7eac..c3ce5d50 100644
--- a/framework/channel_tcp.c
+++ b/framework/channel_tcp.c
@@ -23,6 +23,7 @@
#include <stddef.h>
#include <errno.h>
#include <assert.h>
+#include <string.h>
#include <sys/stat.h>
#include <ctype.h>
#if ENABLE_Unix_Domain
@@ -422,17 +423,17 @@ static void tcp_write_block_stream(OutputStream * out, const char * bytes, size_
while (cnt < size) write_stream(out, (unsigned char)bytes[cnt++]);
}
-static int tcp_splice_block_stream(OutputStream * out, int fd, size_t size, off_t * offset) {
+static ssize_t tcp_splice_block_stream(OutputStream * out, int fd, size_t size, off_t * offset) {
assert(is_dispatch_thread());
if (size == 0) return 0;
#if ENABLE_Splice
{
ChannelTCP * c = channel2tcp(out2channel(out));
if (!c->ssl && out->supports_zero_copy) {
- int rd = splice(fd, offset, c->pipefd[1], NULL, size, SPLICE_F_MOVE);
+ ssize_t rd = splice(fd, offset, c->pipefd[1], NULL, size, SPLICE_F_MOVE);
if (rd > 0) {
/* Send the binary data escape seq */
- unsigned n = rd;
+ size_t n = rd;
if (c->out_bin_block != NULL) tcp_bin_block_end(c);
if (c->chan.out.cur >= c->chan.out.end - 8) tcp_flush_with_flags(c, MSG_MORE);
*c->chan.out.cur++ = ESC;
@@ -460,7 +461,7 @@ static int tcp_splice_block_stream(OutputStream * out, int fd, size_t size, off_
n = rd;
while (n > 0) {
- int wr = splice(c->pipefd[0], NULL, c->socket, NULL, n, SPLICE_F_MORE);
+ ssize_t wr = splice(c->pipefd[0], NULL, c->socket, NULL, n, SPLICE_F_MORE);
if (wr < 0) {
c->out_errno = errno;
@@ -475,7 +476,7 @@ static int tcp_splice_block_stream(OutputStream * out, int fd, size_t size, off_
}
#endif /* ENABLE_Splice */
{
- int rd = 0;
+ ssize_t rd = 0;
char buffer[BUF_SIZE];
if (size > BUF_SIZE) size = BUF_SIZE;
if (offset != NULL) {
diff --git a/framework/errors.c b/framework/errors.c
index 2980f7d2..325a0522 100644
--- a/framework/errors.c
+++ b/framework/errors.c
@@ -392,7 +392,7 @@ int set_errno(int no, const char * msg) {
}
else {
const char * text0 = errno_to_str(no);
- int len = strlen(msg) + strlen(text0) + 4;
+ size_t len = strlen(msg) + strlen(text0) + 4;
char * text1 = (char *)loc_alloc(len);
snprintf(text1, len, "%s. %s", msg, text0);
m->text = text1;
diff --git a/framework/events.c b/framework/events.c
index 868188ec..da4d106f 100644
--- a/framework/events.c
+++ b/framework/events.c
@@ -28,6 +28,7 @@
#include <config.h>
#include <time.h>
#include <assert.h>
+#include <string.h>
#include <framework/myalloc.h>
#include <framework/errors.h>
#include <framework/trace.h>
diff --git a/framework/ip_ifc.c b/framework/ip_ifc.c
index c46d5f9e..14933e08 100644
--- a/framework/ip_ifc.c
+++ b/framework/ip_ifc.c
@@ -20,6 +20,7 @@
#include <stddef.h>
#include <errno.h>
#include <assert.h>
+#include <string.h>
#include <framework/ip_ifc.h>
#include <framework/myalloc.h>
#include <framework/events.h>
diff --git a/framework/json.c b/framework/json.c
index 9127fb5b..8bf5184d 100644
--- a/framework/json.c
+++ b/framework/json.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <assert.h>
+#include <string.h>
#include <framework/json.h>
#include <framework/myalloc.h>
#include <framework/exceptions.h>
diff --git a/framework/mdep.c b/framework/mdep.c
index d8ea4a5a..ac4d96c6 100644
--- a/framework/mdep.c
+++ b/framework/mdep.c
@@ -776,6 +776,8 @@ char * canonicalize_file_name(const char * name) {
#elif defined(_WRS_KERNEL)
+#include <string.h>
+
char * canonicalize_file_name(const char * path) {
char buf[PATH_MAX];
size_t i = 0;
diff --git a/framework/peer.c b/framework/peer.c
index 7f5d1def..a7dc6e69 100644
--- a/framework/peer.c
+++ b/framework/peer.c
@@ -20,6 +20,7 @@
#include <stddef.h>
#include <errno.h>
#include <assert.h>
+#include <string.h>
#include <framework/tcf.h>
#include <framework/peer.h>
#include <framework/myalloc.h>
diff --git a/framework/streams.c b/framework/streams.c
index 899c7e2d..aaecacc8 100644
--- a/framework/streams.c
+++ b/framework/streams.c
@@ -18,6 +18,7 @@
#include <config.h>
#include <stddef.h>
+#include <string.h>
#include <framework/myalloc.h>
#include <framework/streams.h>
diff --git a/framework/streams.h b/framework/streams.h
index a624b02f..9e0e17e0 100644
--- a/framework/streams.h
+++ b/framework/streams.h
@@ -40,7 +40,7 @@ struct OutputStream {
unsigned char * end;
void (*write)(OutputStream * stream, int byte);
void (*write_block)(OutputStream * stream, const char * bytes, size_t size);
- int (*splice_block)(OutputStream * stream, int fd, size_t size, off_t * offset);
+ ssize_t (*splice_block)(OutputStream * stream, int fd, size_t size, off_t * offset);
};
typedef struct InputStream InputStream;
diff --git a/framework/trace.c b/framework/trace.c
index 7caa02b7..897fc488 100644
--- a/framework/trace.c
+++ b/framework/trace.c
@@ -23,6 +23,7 @@ int log_mode = LOG_EVENTS | LOG_CHILD | LOG_WAITPID | LOG_CONTEXT | LOG_PROTOCOL
#include <stdarg.h>
#include <stdio.h>
#include <errno.h>
+#include <string.h>
#if defined(WIN32)
#elif defined(_WRS_KERNEL)
diff --git a/services/diagnostics.c b/services/diagnostics.c
index ae5d316d..2582fbb5 100644
--- a/services/diagnostics.c
+++ b/services/diagnostics.c
@@ -21,6 +21,7 @@
#include <signal.h>
#include <assert.h>
#include <stdio.h>
+#include <string.h>
#include <framework/protocol.h>
#include <framework/json.h>
#include <framework/exceptions.h>
diff --git a/services/discovery.c b/services/discovery.c
index db9dc955..fa9211f8 100644
--- a/services/discovery.c
+++ b/services/discovery.c
@@ -21,6 +21,7 @@
#include <stddef.h>
#include <errno.h>
#include <assert.h>
+#include <string.h>
#include <framework/protocol.h>
#include <framework/channel.h>
#include <framework/proxy.h>
diff --git a/services/discovery_udp.c b/services/discovery_udp.c
index 657cbd7c..29412762 100644
--- a/services/discovery_udp.c
+++ b/services/discovery_udp.c
@@ -41,6 +41,7 @@
#include <stddef.h>
#include <errno.h>
#include <assert.h>
+#include <string.h>
#include <framework/tcf.h>
#include <framework/myalloc.h>
#include <framework/events.h>
@@ -658,8 +659,8 @@ static void udp_receive_req_slaves(SlaveInfo * s, time_t timenow) {
}
static void udp_receive_ack_slaves(time_t timenow) {
- int pos = 8;
- int len = recvreq.u.sio.rval;
+ ssize_t pos = 8;
+ ssize_t len = recvreq.u.sio.rval;
while (pos < len) {
struct sockaddr_in addr;
uint64_t timestamp;
diff --git a/services/streamsservice.c b/services/streamsservice.c
index e107a0b1..675e863c 100644
--- a/services/streamsservice.c
+++ b/services/streamsservice.c
@@ -21,6 +21,7 @@
#if SERVICE_Streams
#include <assert.h>
+#include <string.h>
#include <framework/channel.h>
#include <framework/exceptions.h>
#include <framework/json.h>
@@ -512,8 +513,8 @@ int virtual_stream_get_data(VirtualStream * stream, char * buf, size_t buf_size,
memcpy(buf, stream->buf + stream->buf_out, len);
}
else {
- unsigned x = stream->buf_len - stream->buf_out;
- unsigned y = len - x;
+ size_t x = stream->buf_len - stream->buf_out;
+ size_t y = len - x;
memcpy(buf, stream->buf + stream->buf_out, x);
memcpy(buf + x, stream->buf, y);
}
@@ -687,7 +688,7 @@ static void command_write(char * token, Channel * c) {
{
JsonReadBinaryState state;
- unsigned data_pos = 0;
+ size_t data_pos = 0;
if (!err && !list_is_empty(&client->write_requests)) data = (char *)loc_alloc(size);

Back to the top