X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fserver%2Fgdb_server.c;h=170dadc55f5ba04a7612820439e276333d7733a6;hp=1d1d836385f67e25d9d2ba5cf28a210fd38d352c;hb=cb2dba2c1257e0aa80edc9a171a9c5cd7b2822f8;hpb=3099858c68fd3a5f9960daea429198c0fc5a0f10 diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 1d1d836385..170dadc55f 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1,4 +1,3 @@ - /*************************************************************************** * Copyright (C) 2005 by Dominic Rath * * Dominic.Rath@gmx.de * @@ -177,7 +176,7 @@ static int gdb_get_char_inner(struct connection *connection, int* next_char) #endif for (;;) { - if (connection->service->type == CONNECTION_PIPE) + if (connection->service->type != CONNECTION_TCP) { gdb_con->buf_cnt = read(connection->fd, gdb_con->buffer, GDB_BUFFER_SIZE); } @@ -329,20 +328,9 @@ static int gdb_write(struct connection *connection, void *data, int len) if (gdb_con->closed) return ERROR_SERVER_REMOTE_CLOSED; - if (connection->service->type == CONNECTION_PIPE) + if (connection_write(connection, data, len) == len) { - /* write to stdout */ - if (write(STDOUT_FILENO, data, len) == len) - { - return ERROR_OK; - } - } - else - { - if (write_socket(connection->fd, data, len) == len) - { - return ERROR_OK; - } + return ERROR_OK; } gdb_con->closed = 1; return ERROR_SERVER_REMOTE_CLOSED;