Merge branch 'master' of ssh://git.indexdata.com:222/home/git/pub/metaproxy
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 2 Aug 2011 08:11:10 +0000 (10:11 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 2 Aug 2011 08:11:10 +0000 (10:11 +0200)
1  2 
src/filter_zoom.cpp

diff --combined src/filter_zoom.cpp
@@@ -20,7 -20,6 +20,6 @@@ Foundation, Inc., 51 Franklin St, Fift
  
  #include <stdlib.h>
  #include <sys/types.h>
- #include <fcntl.h>
  #include "filter_zoom.hpp"
  #include <yaz/zoom.h>
  #include <yaz/yaz-version.h>
@@@ -53,8 -52,7 +52,8 @@@ namespace yf = mp::filter
  
  namespace metaproxy_1 {
      namespace filter {
 -        struct Zoom::Searchable : boost::noncopyable {
 +        class Zoom::Searchable : boost::noncopyable {
 +          public:
              std::string authentication;
              std::string cfAuth;
              std::string cfProxy;
@@@ -371,7 -369,7 +370,7 @@@ yf::Zoom::Impl::Impl() 
  {
      bibset = ccl_qual_mk();
  
 -    srand(time(0));
 +    srand((unsigned int) time(0));
  }
  
  yf::Zoom::Impl::~Impl()
@@@ -854,8 -852,8 +853,8 @@@ yf::Zoom::BackendPtr yf::Zoom::Frontend
          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;
              wrbuf_printf(w, "authentication: %s\n", authentication.c_str());
          if (proxy.length())
              wrbuf_printf(w, "proxy: %s\n", proxy.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);
      }
@@@ -928,7 -924,7 +925,7 @@@ Z_Records *yf::Zoom::Frontend::get_reco
          number_to_present = 10000;
      
      ZOOM_record *recs = (ZOOM_record *)
 -        odr_malloc(odr, number_to_present * sizeof(*recs));
 +        odr_malloc(odr, (size_t) number_to_present * sizeof(*recs));
  
      char oid_name_str[OID_STR_MAX];
      const char *syntax_name = 0;
  
      b->present(start, number_to_present, recs, error, addinfo, odr);
  
 -    Odr_int i = 0;
 +    int i = 0;
      if (!*error)
      {
          for (i = 0; i < number_to_present; i++)