X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Ffilter_zoom.cpp;h=e8863ffb1d3fbf71580535d175cb840f63256ad6;hb=d2a1afba74f86ba46a8b2783235f45ebeb92c76f;hp=2c70e94458ee600974e39329437cf4c940840ed8;hpb=5d21a3cf208a7bc9951846dab4b8b6ff97b46863;p=metaproxy-moved-to-github.git diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index 2c70e94..e8863ff 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -20,7 +20,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include -#include #include "filter_zoom.hpp" #include #include @@ -854,8 +853,8 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( sprintf(xx, "%06d", ((unsigned) rand()) % 1000000); xx[6] = tmp_char; - int fd = creat(fname, 0666); - if (fd == -1) + FILE *file = fopen(fname, "w"); + if (!file) { yaz_log(YLOG_WARN|YLOG_ERRNO, "create %s", fname); *error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR; @@ -873,13 +872,11 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( wrbuf_printf(w, "authentication: %s\n", authentication.c_str()); if (proxy.length()) wrbuf_printf(w, "proxy: %s\n", proxy.c_str()); - if (sptr->cfAuth.length()) - wrbuf_printf(w, "cfauth: %s\n", sptr->cfAuth.c_str()); if (sptr->cfProxy.length()) wrbuf_printf(w, "cfproxy: %s\n", sptr->cfProxy.c_str()); - write(fd, wrbuf_buf(w), wrbuf_len(w)); - close(fd); + fwrite(wrbuf_buf(w), 1, wrbuf_len(w), file); + fclose(file); yaz_log(YLOG_LOG, "file %s created\n", fname); xfree(fname); }