Project

General

Profile

Bug #1277 ยป ossl_bio.patch

cfis (Charlie Savage), 03/13/2009 01:21 AM

View differences:

ext/openssl/ossl_bio.c (working copy)
if (TYPE(obj) == T_FILE) {
rb_io_t *fptr;
FILE *fp;
int fd;
GetOpenFile(obj, fptr);
......
if ((fd = dup(FPTR_TO_FD(fptr))) < 0){
rb_sys_fail(0);
}
if (!(fp = fdopen(fd, "r"))){
close(fd);
rb_sys_fail(0);
}
if (!(bio = BIO_new_fp(fp, BIO_CLOSE))){
fclose(fp);
if (!(bio = BIO_new_file(RSTRING_PTR(fptr->pathv), "r"))){
ossl_raise(eOSSLError, NULL);
}
}
    (1-1/1)