All pastes #501111 Raw Edit

Stuff

public text v1 · immutable
·published 2007-05-21 21:28 UTC
rendered paste body
int gest_socket ()
	{
		int bytes_read = 1;
		while (bytes_read != 0) {
			if ((bytes_read = read(sock, buffer, LG_BUFFER)) == 0)
				exit(EXIT_FAILURE);
			if (bytes_read < 0) {
				perror("read");
				exit(EXIT_FAILURE);
			}
				write(STDOUT_FILENO, buffer, bytes_read);
		}
		return (bytes_read);
	}