errno is a restricted variable in Windows (fail)

the_jinx [2011-05-11 19:40]
errno is a restricted variable in Windows (fail)

git-svn-id: https://old.setv.nl/svn/swarmtv@317 88541080-9ad6-de11-9093-5254007c1f44
Filename
trunk/swarmtv/libswarmtv/database.c
trunk/swarmtv/libswarmtv/torrentdb.c
diff --git a/trunk/swarmtv/libswarmtv/database.c b/trunk/swarmtv/libswarmtv/database.c
index e49e6dc..006ee35 100644
--- a/trunk/swarmtv/libswarmtv/database.c
+++ b/trunk/swarmtv/libswarmtv/database.c
@@ -326,7 +326,7 @@ int rsstexecutequery(sqlite3 *db, const char *query, char *fmt, ...)
   double       	f=0.0;
   int          	count=0;
   int          	changes=0;
-  int           errno=0;
+  int           errnum=0;
   const char   *errstring=NULL;

   /*
@@ -417,7 +417,7 @@ int rsstexecutequery(sqlite3 *db, const char *query, char *fmt, ...)
         retval=ROWS_CONSTRAINT;
         break;
       default:
-        errno = sqlite3_errcode(db);
+        errnum = sqlite3_errcode(db);
         errstring = sqlite3_errmsg(db);
         /*
          * Workaround for older sqlite3 libraries, I hope they will upgrade soon to v2 compatible versions of sqlite
diff --git a/trunk/swarmtv/libswarmtv/torrentdb.c b/trunk/swarmtv/libswarmtv/torrentdb.c
index e0bd897..4de1408 100644
--- a/trunk/swarmtv/libswarmtv/torrentdb.c
+++ b/trunk/swarmtv/libswarmtv/torrentdb.c
@@ -96,7 +96,7 @@ int rsstaddnewtorrent(rsstor_handle *handle, newtorrents_struct *newtor)
   int           rc=0;
 	sqlite3      *db=NULL;
   const char   *error=NULL;
-  int           errno=0;
+  int           errnum=0;

 	/*
 	 * Get db pointer;
@@ -143,19 +143,19 @@ int rsstaddnewtorrent(rsstor_handle *handle, newtorrents_struct *newtor)
       rsstwritelog(LOG_DEBUG, "Torrent already in DB");
       break;
     default:
-      errno = sqlite3_errcode(db);
+      errnum = sqlite3_errcode(db);
       error = sqlite3_errmsg(db);
 /*
  * Workaround for older sqlite3 libraries.
  */
 #if SQLITE_VERSION_NUMBER >= 3003009
-      rsstwritelog(LOG_ERROR, "SQL statement failed '%d'! %s %s:%d", errno, error, __FILE__, __LINE__);
+      rsstwritelog(LOG_ERROR, "SQL statement failed '%d'! %s %s:%d", errnum, error, __FILE__, __LINE__);
       exit(1);
 #else
-      if(errno == SQLITE_CONSTRAINT) {
+      if(errnum == SQLITE_CONSTRAINT) {
         rsstwritelog(LOG_DEBUG, "Torrent already in DB");
       } else {
-        rsstwritelog(LOG_ERROR, "SQL statement failed '%d'! %s %s:%d", errno, error, __FILE__, __LINE__);
+        rsstwritelog(LOG_ERROR, "SQL statement failed '%d'! %s %s:%d", errnum, error, __FILE__, __LINE__);
         exit(1);
       }
 #endif