Commit d4760d54 authored by Erick Gallesio's avatar Erick Gallesio

Going back (once again) of socket.c. Previous modification introduced

a severe regression
parent 3b30fa44
/*
This file was automatically generated by make-C-boot
This is a dump of the image in file /mnt/users/eg/Projects/STklos/lib/boot.img3
This is a dump of the image in file /misc/home/eg/Projects/STklos/lib/boot.img3
***DO NOT EDIT BY HAND***
*/
......
This diff is collapsed.
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 8-Jan-2000 14:48 (eg)
* Last file update: 14-Aug-2007 16:27 (eg)
* Last file update: 29-Jun-2007 22:27 (eg)
*
* This implementation is built by reverse engineering on an old SUNOS 4.1.1
* stdio.h. It has been simplified to fit the needs for STklos. In particular
......@@ -181,12 +181,6 @@ static int flush_buffer(struct fstream *f)
return ret < 0;
}
int STk_fport_flush_buffer(struct fstream *f)
{
/* Exported version of the previous one */
return flush_buffer(f);
}
/*=============================================================================*/
......
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 8-Jan-2000 14:48 (eg)
* Last file update: 14-Aug-2007 16:30 (eg)
* Last file update: 29-Jun-2007 22:18 (eg)
*
* This implementation is built by reverse engineering on an old SUNOS 4.1.1
* stdio.h. It has been simplified to fit the needs for STklos. In particular
......@@ -69,5 +69,3 @@ struct fstream {
#define PORT_USERDATA(x) (((struct fstream *) (x))->user_data)
#define PORT_LOWREAD(x) (((struct fstream *) (x))->low_read)
#define PORT_LOWWRITE(x) (((struct fstream *) (x))->low_write)
int STk_fport_flush_buffer(struct fstream *f);
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@essi.fr]
* Creation date: 3-Jan-2003 18:45 (eg)
* Last file update: 14-Aug-2007 16:54 (eg)
* Last file update: 13-Apr-2007 18:36 (eg)
*/
#include <sys/types.h>
......@@ -34,7 +34,6 @@
#include <stklos.h>
#include "socket.h"
#include "fport.h"
#ifdef THREADS_LURC
# include <lurc.h>
......@@ -102,21 +101,6 @@ static void error_bad_socket(SCM obj)
STk_error("bad socket ~S", obj);
}
/* ------------------------------ */
static int socket_close_input(void *stream)
{
return shutdown(PORT_FD(stream), SHUT_RD);
}
static int socket_close_output (void *stream)
{
int ret = STk_fport_flush_buffer(stream);
return (ret == EOF) ? EOF : shutdown(PORT_FD(stream), SHUT_WR);
}
/* ------------------------------ */
static void set_socket_io_ports(SCM sock, int line_buffered)
{
......@@ -129,17 +113,13 @@ static void set_socket_io_ports(SCM sock, int line_buffered)
sprintf(fname, "%s:%ld", hostname, SOCKET_PORTNUM(sock));
s = SOCKET_FD(sock);
t = s; /* was t = dup(s); */
t = dup(s);
in = STk_fd2scheme_port(s, "r", fname);
out = STk_fd2scheme_port(t, "w", fname);
if (NULLP(in) || NULLP(out))
STk_error("cannot create socket IO ports");
PORT_CLOSE(in) = socket_close_input; /* Patch the close function */
PORT_CLOSE(out) = socket_close_output; /* Patch the close function */
SOCKET_IN(sock) = in;
SOCKET_OUT(sock) = out;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment