return -1;
#endif
}
-
-/* raw_read|write section */
-#if defined(_WIN32) && defined(STD_INPUT_HANDLE)
-int
-raw_read_stdin(void *buf, int siz)
-{
- DWORD n;
- if (ReadFile(GetStdHandle(STD_INPUT_HANDLE), buf, siz, &n, NULL))
- return (n);
- else
- return (-1);
-}
-#else
-int
-raw_read_stdin(void *buf, int siz)
-{
- return read(fileno(stdin), buf, siz);
-}
-#endif
-
-#if defined(_WIN32) && defined(STD_OUTPUT_HANDLE)
-int
-raw_write_stdout(const void *buf, int siz)
-{
- DWORD n;
- if (WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), buf, siz, &n, NULL))
- return (n);
- else
- return (-1);
-}
-#else
-int
-raw_write_stdout(const void *buf, int siz)
-{
- return write(fileno(stdout), buf, siz);
-}
-#endif
#define SERIAL_RAND_BITS 64
int app_isdir(const char *);
-int raw_read_stdin(void *, int);
-int raw_write_stdout(const void *, int);
#define TM_START 0
#define TM_STOP 1
goto shut;
}
} else if (!ssl_pending && FD_ISSET(fileno(stdout), &writefds)) {
- i = raw_write_stdout(&(sbuf[sbuf_off]), sbuf_len);
+ i = write(fileno(stdout), &(sbuf[sbuf_off]), sbuf_len);
if (i <= 0) {
BIO_printf(bio_c_out, "DONE\n");
if (crlf) {
int j, lf_num;
- i = raw_read_stdin(cbuf, BUFSIZZ / 2);
+ i = read(fileno(stdin), cbuf, BUFSIZZ / 2);
lf_num = 0;
/* both loops are skipped when i <= 0 */
for (j = 0; j < i; j++)
}
assert(lf_num == 0);
} else
- i = raw_read_stdin(cbuf, BUFSIZZ);
+ i = read(fileno(stdin), cbuf, BUFSIZZ);
if ((!c_ign_eof) && ((i <= 0) || (cbuf[0] == 'Q'))) {
BIO_printf(bio_err, "DONE\n");
if (s_crlf) {
int j, lf_num;
- i = raw_read_stdin(buf, bufsize / 2);
+ i = read(fileno(stdin), buf, bufsize / 2);
lf_num = 0;
/* both loops are skipped when i <= 0 */
for (j = 0; j < i; j++)
}
assert(lf_num == 0);
} else
- i = raw_read_stdin(buf, bufsize);
+ i = read(fileno(stdin), buf, bufsize);
if (!s_quiet) {
if ((i <= 0) || (buf[0] == 'Q')) {
BIO_printf(bio_s_out, "DONE\n");
#endif
switch (SSL_get_error(con, i)) {
case SSL_ERROR_NONE:
- raw_write_stdout(buf,
+ write(fileno(stdout), buf,
(unsigned int) i);
if (SSL_pending(con))
goto again;