Index: Singular/fevoices.cc
===================================================================
--- Singular/fevoices.cc	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ Singular/fevoices.cc	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -27,5 +27,4 @@
 #include <omalloc/omalloc.h>
 #include <reporter/reporter.h>
-#include <resources/feFopen.h>
 #include <misc/options.h>
 
Index: Singular/mpsr_sl.cc
===================================================================
--- Singular/mpsr_sl.cc	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ Singular/mpsr_sl.cc	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -294,4 +294,5 @@
       l->data = (void *) link;
       fe_fgets_stdin=fe_fgets_dummy;
+      WerrorS_callback=WerrorS_batch;
       singular_in_batchmode=TRUE;
       //myynest=0;
Index: Singular/ssiLink.cc
===================================================================
--- Singular/ssiLink.cc	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ Singular/ssiLink.cc	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -784,4 +784,5 @@
           //myynest=0;
           fe_fgets_stdin=fe_fgets_dummy;
+	  WerrorS_callback=WerrorS_batch;
           if ((u!=NULL)&&(u->rtyp==IDHDL))
           {
Index: findexec/Makefile.am
===================================================================
--- findexec/Makefile.am	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ findexec/Makefile.am	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -16,5 +16,5 @@
 INCLUDES = -I${top_srcdir} -I${top_builddir} 
 
-SOURCES  = omFindExec.c feResource.cc
+SOURCES  = omFindExec.c feResource.cc feFopen.cc
 libfindexec_la_SOURCES   = $(SOURCES)
 libfindexec_g_la_SOURCES = $(SOURCES)
@@ -22,5 +22,5 @@
 libfindexec_includedir  =$(includedir)/singular/findexec/
 
-libfindexec_include_HEADERS = omFindExec.h feResource.h
+libfindexec_include_HEADERS = omFindExec.h feResource.h feFopen.h
 
 
Index: kernel/febase.cc
===================================================================
--- kernel/febase.cc	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ kernel/febase.cc	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -27,5 +27,4 @@
 #include <omalloc/omalloc.h>
 #include <reporter/reporter.h>
-#include <resources/feFopen.h>
 #include <misc/options.h>
 
Index: kernel/febase.h
===================================================================
--- kernel/febase.h	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ kernel/febase.h	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -10,5 +10,4 @@
 #include <reporter/reporter.h>
 
-#include <resources/feFopen.h>
 #include <findexec/feResource.h>
 
Index: kernel/feread.cc
===================================================================
--- kernel/feread.cc	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ kernel/feread.cc	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -27,9 +27,4 @@
 #ifdef HAVE_STATIC
 #undef HAVE_DYN_RL
-#endif
-
-#ifdef ix86_Linux
-#undef HAVE_FEREAD
-// not compatible with glibc2
 #endif
 
Index: libpolys/coeffs/ffields.cc
===================================================================
--- libpolys/coeffs/ffields.cc	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ libpolys/coeffs/ffields.cc	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -15,5 +15,4 @@
 
 #include <reporter/reporter.h>
-#include <resources/feFopen.h>
 
 #include <coeffs/coeffs.h>
Index: libpolys/coeffs/gnumpc.cc
===================================================================
--- libpolys/coeffs/gnumpc.cc	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ libpolys/coeffs/gnumpc.cc	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -17,5 +17,4 @@
 
 #include <reporter/reporter.h>
-#include <resources/feFopen.h>
 
 #include <coeffs/coeffs.h>
Index: libpolys/polys/mod_raw.cc
===================================================================
--- libpolys/polys/mod_raw.cc	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ libpolys/polys/mod_raw.cc	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -25,5 +25,4 @@
 
 #include <findexec/feResource.h>
-#include <resources/feFopen.h>
 
 #include "mod_raw.h"
Index: libpolys/reporter/reporter.cc
===================================================================
--- libpolys/reporter/reporter.cc	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ libpolys/reporter/reporter.cc	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -22,4 +22,5 @@
 #include <reporter/reporter.h>
 #include <findexec/feResource.h>
+#include <findexec/feFopen.h>
 #include <omalloc/omalloc.h>
 //#include "options.h"
@@ -37,5 +38,4 @@
 static char * feBuffer=(char *)omAlloc(INITIAL_PRINT_BUFFER);
 
-BOOLEAN errorreported = FALSE;
 char *  feErrors=NULL;
 int     feErrorsLen=0;
@@ -43,5 +43,5 @@
 BOOLEAN feOut = TRUE;
 
-void (*WerrorS_callback)(const char *s) = NULL;
+//void (*WerrorS_callback)(const char *s) = NULL;
 
 const char feNotImplemented[]="not implemented";
@@ -147,66 +147,23 @@
 #endif
 
-extern "C" {
-void WerrorS(const char *s)
-{
-#ifdef HAVE_MPSR
-  if (fe_fgets_stdin==fe_fgets_dummy)
-  {
-    if (feErrors==NULL)
-    {
-      feErrors=(char *)omAlloc(256);
-      feErrorsLen=256;
-      *feErrors = '\0';
-    }
-    else
-    {
-      if (((int)(strlen((char *)s)+ 20 +strlen(feErrors)))>=feErrorsLen)
-      {
-        feErrors=(char *)omReallocSize(feErrors,feErrorsLen,feErrorsLen+256);
-        feErrorsLen+=256;
-      }
-    }
-    strcat(feErrors, "Singular error: ");
-    strcat(feErrors, (char *)s);
+void WerrorS_batch(const char *s)
+{
+  if (feErrors==NULL)
+  {
+    feErrors=(char *)omAlloc(256);
+    feErrorsLen=256;
+    *feErrors = '\0';
   }
   else
-#endif
-  {
-#ifdef HAVE_TCL
-    if (tclmode)
-    {
-      PrintTCLS('E',(char *)s);
-      PrintTCLS('E',"\n");
-    }
-    else
-#endif
-    {
-      if (WerrorS_callback == NULL)
-      {
-        fwrite("   ? ",1,5,stderr);
-        fwrite((char *)s,1,strlen((char *)s),stderr);
-        fwrite("\n",1,1,stderr);
-        fflush(stderr);
-      }
-      else
-      {
-        WerrorS_callback(s);
-      }
-      if (feProt&PROT_O)
-      {
-        fwrite("   ? ",1,5,feProtFile);
-        fwrite((char *)s,1,strlen((char *)s),feProtFile);
-        fwrite("\n",1,1,feProtFile);
-      }
-    }
-  }
+  {
+    if (((int)(strlen((char *)s)+ 20 +strlen(feErrors)))>=feErrorsLen)
+    {
+      feErrors=(char *)omReallocSize(feErrors,feErrorsLen,feErrorsLen+256);
+      feErrorsLen+=256;
+    }
+  }
+  strcat(feErrors, "Singular error: ");
+  strcat(feErrors, (char *)s);
   errorreported = TRUE;
-#ifdef HAVE_FACTORY
-#ifdef HAVE_LIBFAC
-  // libfac:
-  extern int libfac_interruptflag;
-  libfac_interruptflag=1;
-#endif
-#endif
 }
 
@@ -248,5 +205,4 @@
   }
 }
-} /* end extern "C" */
 
 void Warn(const char *fmt, ...)
Index: libpolys/reporter/reporter.h
===================================================================
--- libpolys/reporter/reporter.h	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ libpolys/reporter/reporter.h	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -10,4 +10,5 @@
 #include <string.h>
 #include <misc/auxiliary.h>
+#include <findexec/feFopen.h>
 
 extern char*  feErrors;
@@ -18,5 +19,4 @@
 extern int    yy_noeof;
 extern const char feNotImplemented[];
-extern BOOLEAN errorreported;
 extern int     feProt;
 extern BOOLEAN feWarn;
@@ -44,5 +44,5 @@
 
 void    Werror(const char *fmt, ...) __attribute__((format(printf,1,2)));
-void    WerrorS(const char *s);
+void    WerrorS_batch(const char *s);
 void    WarnS(const char *s);
 void    Print(const char* fmt, ...) __attribute__((format(printf,1,2)));
@@ -81,5 +81,4 @@
 {
 #endif
-extern void (*WerrorS_callback)(const char *s);
 extern int dReportError(const char* fmt, ...);
 #define dReportBug(s) \
Index: libpolys/resources/Makefile.am
===================================================================
--- libpolys/resources/Makefile.am	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ libpolys/resources/Makefile.am	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -16,5 +16,5 @@
 INCLUDES = -I${top_srcdir} -I${top_srcdir}/.. -I${top_builddir} -I${top_builddir}/..
 
-SOURCES = feFopen.cc
+SOURCES = 
 libresources_la_SOURCES   = $(SOURCES)
 libresources_g_la_SOURCES = $(SOURCES)
@@ -22,5 +22,5 @@
 libresources_includedir  =$(includedir)/singular/resources
 
-libresources_include_HEADERS   = feFopen.h
+libresources_include_HEADERS   =
 
 
Index: libpolys/resources/feFopen.cc
===================================================================
--- libpolys/resources/feFopen.cc	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ libpolys/resources/feFopen.cc	(revision 8544050285b638f1ca103ce35603f58fd1b2d55f)
@@ -1,178 +1,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "config.h"
-#include <misc/auxiliary.h>
-
-#include <reporter/reporter.h>
-
-#include "feFopen.h"
-#include <findexec/feResource.h>
-
-
-
-/*****************************************************************
- *
- * File handling
- *
- *****************************************************************/
-
-FILE * feFopen(const char *path, const char *mode, char *where,
-               BOOLEAN useWerror, BOOLEAN path_only)
-{
-  char longpath[MAXPATHLEN];
-  if (path[0]=='~')
-  {
-    if (path[1] == DIR_SEP)
-    {
-      const char* home = getenv("HOME");
-#ifdef ix86_Win
-      if ((home==NULL)||(!access(home,X_OK)))
-        home = getenv("SINGHOME");
-#endif
-      if (home != NULL)
-      {
-        strcpy(longpath, home);
-        strcat(longpath, &(path[1]));
-        path = longpath;
-      }
-    }
-#if defined(HAVE_PWD_H) && defined(HAVE_GETPWNAM)
-    else
-    {
-      char* dir_sep;
-      struct passwd *pw_entry;
-      strcpy (longpath, path);
-      dir_sep = strchr(longpath, DIR_SEP);
-      if (dir_sep==NULL)
-      {
-        Werror(" illegal ~ in filename >>%s<<",longpath);
-        return NULL;
-      }
-      *dir_sep = '\0';
-      pw_entry = getpwnam(&longpath[1]);
-      if (pw_entry != NULL)
-      {
-        strcpy(longpath, pw_entry->pw_dir);
-        dir_sep = strchr((char *)path, DIR_SEP);
-        strcat(longpath, dir_sep);
-        path = longpath;
-      }
-    }
-#endif
-  }
-  FILE * f=NULL;
-  if (! path_only)
-  {
-    struct stat statbuf;
-    if ((stat(path,&statbuf)==0)
-    && (S_ISREG(statbuf.st_mode)))
-      f = myfopen(path,mode);
-  }
-  if (where!=NULL) strcpy(where,path);
-  if ((*mode=='r') &&
-      (path[0]!=DIR_SEP) &&
-      ! (path[0] == '.' && path[1] == DIR_SEP) &&
-      (f==NULL))
-  {
-    char found = 0;
-    char* spath = feResource('s');
-    char *s;
-
-    if (where==NULL) s=(char *)malloc(1024);
-    else             s=where;
-
-    if (spath!=NULL)
-    {
-      char *p,*q;
-      p = spath;
-      while( (q=strchr(p, fePathSep)) != NULL)
-      {
-        *q = '\0';
-        strcpy(s,p);
-        *q = fePathSep;
-        strcat(s, DIR_SEPP);
-        strcat(s, path);
-        if(!access(s, R_OK)) { found++; break; }
-        p = q+1;
-      }
-      if(!found)
-      {
-        strcpy(s,p);
-        strcat(s, DIR_SEPP);
-        strcat(s, path);
-      }
-      f=myfopen(s,mode);
-      if (f!=NULL)
-      {
-        if (where==NULL) free((ADDRESS)s);
-        return f;
-      }
-    }
-    else
-    {
-      if (where!=NULL) strcpy(s/*where*/,path);
-      f=myfopen(path,mode);
-    }
-    if (where==NULL) free((ADDRESS)s);
-  }
-  if ((f==NULL)&&(useWerror))
-    Werror("cannot open `%s`",path);
-  return f;
-}
-
-FILE * feFopen(const char *path, const char *mode)
-{
-  return feFopen (path, mode, 0,0,0);
-}
-
-// Make sure that mode contains binary option
-FILE* myfopen(const char *path, const char *mode)
-{
-#if (defined(CYGWIN) || defined(ix86_Win))
-  char mmode[4];
-  int i;
-  int done = 0;
-
-  for (i=0;;i++)
-  {
-    mmode[i] = mode[i];
-    if (mode[i] == '\0') break;
-    if (mode[i] == 'w') done = 1;
-    if (mode[i] == 'a') done = 1;
-    if (mode[i] == 'b') done = 1;
-  }
-
-  if (! done)
-  {
-    mmode[i] = 'b';
-    mmode[i+1] = '\0';
-  }
-  return fopen(path, mmode);
-#else
-  return fopen(path, mode);
-#endif
-}
-// replace "\r\n" by " \n" and "\r" by "\n"
-
-size_t myfread(void *ptr, size_t size, size_t nmemb, FILE *stream)
-{
-  size_t got = fread(ptr, size, nmemb, stream) * size;
-  size_t i;
-
-  for (i=0; i<got; i++)
-  {
-    if ( ((char*) ptr)[i] == '\r')
-    {
-      if (i+1 < got && ((char*) ptr)[i+1] == '\n')
-        ((char*) ptr)[i] = ' ';
-      else
-        ((char*) ptr)[i] = '\n';
-    }
-  }
-  return got;
-}
Index: bpolys/resources/feFopen.h
===================================================================
--- libpolys/resources/feFopen.h	(revision a10fdfe4d442bc04f32d34fcfb152911e9097218)
+++ 	(revision )
@@ -1,29 +1,0 @@
-#ifndef FEFOPEN_H
-#define FEFOPEN_H
-
-#include <misc/auxiliary.h>
-
-/*****************************************************************
- *
- * File Stuff
- *
- *****************************************************************/
-#ifdef __cplusplus
-
-FILE*feFopen(const char *path, const char *mode, char *where, BOOLEAN useWerror=FALSE, BOOLEAN path_only=FALSE);
-FILE*feFopen(const char *path, const char *mode);
-/*
-// These are our versions of fopen and fread They are very similar to
-// the usual fopen and fread, except that on reading, they always
-// convert "\r\n" into " \n" and "\r" into "\n".
-//
-// IMPORTANT: do only use myfopen and myfread when reading text,
-// do never use fopen and fread
-*/
-
-FILE *myfopen(const char *path, const char *mode);
-
-size_t myfread(void *ptr, size_t size, size_t nmemb, FILE *stream);
-
-#endif
-#endif
