diff --git a/src/modules/files/file.c b/src/modules/files/file.c
index 5b3f8f2ff0eb59d32e253f5bcecd90cdfaa397d0..dd94d48fa8d34daf2051c600f9dd1685cab10ba8 100644
--- a/src/modules/files/file.c
+++ b/src/modules/files/file.c
@@ -5,7 +5,7 @@
 \*/
 
 #include "global.h"
-RCSID("$Id: file.c,v 1.98 1998/05/22 08:25:54 neotron Exp $");
+RCSID("$Id: file.c,v 1.99 1998/05/22 11:34:42 grubba Exp $");
 #include "fdlib.h"
 #include "interpret.h"
 #include "svalue.h"
@@ -1195,17 +1195,21 @@ static void file_set_buffer(INT32 args)
   if(bufsize>SOCKET_BUFFER_MAX) bufsize=SOCKET_BUFFER_MAX;
 #endif
   flags &= THIS->open_mode;
+#ifdef SO_RCVBUF
   if(flags & FILE_READ)
   {
     int tmp=bufsize;
     fd_setsockopt(FD,SOL_SOCKET, SO_RCVBUF, (char *)&tmp, sizeof(tmp));
   }
+#endif /* SO_RCVBUF */
 
+#ifdef SO_SNDBUF
   if(flags & FILE_WRITE)
   {
     int tmp=bufsize;
     fd_setsockopt(FD,SOL_SOCKET, SO_SNDBUF, (char *)&tmp, sizeof(tmp));
   }
+#endif /* SO_SNDBUF */
 #endif
 }