Index: libroar/basic.c
===================================================================
--- libroar/basic.c	(revision 5146)
+++ libroar/basic.c	(revision 5148)
@@ -374,4 +374,5 @@
 
 int roar_wait_msg     (struct roar_connection * con, int16_t seq, int16_t seqmask) {
+ roar_err_set(ROAR_ERROR_NOSYS);
  return -1;
 }
@@ -381,4 +382,5 @@
 
  if ( con == NULL ) {
+  roar_err_set(ROAR_ERROR_FAULT);
   return -1;
  }
@@ -436,6 +438,10 @@
 
 int roar_debug_message_print (struct roar_message * mes) {
- if ( mes == NULL )
-  return -1;
+ roar_debug_warn_obsolete("roar_debug_message_print", NULL, NULL);
+
+ if ( mes == NULL ) {
+  roar_err_set(ROAR_ERROR_FAULT);
+  return -1;
+ }
 
  ROAR_DBG("roar_debug_message_print(*): Command: %i", mes->cmd);
@@ -449,6 +455,8 @@
 
 int roar_debug_audio_info_print (struct roar_audio_info * info) {
- if ( info == NULL )
-  return -1;
+ if ( info == NULL ) {
+  roar_err_set(ROAR_ERROR_FAULT);
+  return -1;
+ }
 
  ROAR_DBG("roar_debug_audio_info_print(*): Rate    : %i", info->rate);
Index: libroar/ctl.c
===================================================================
--- libroar/ctl.c	(revision 5145)
+++ libroar/ctl.c	(revision 5148)
@@ -325,5 +325,6 @@
 
  if ( m->data[0] != 0 ) {
-  ROAR_ERR("roar_ctl_m2f(*): version %i not supported!", (int)m->data[0]);
+  ROAR_DBG("roar_ctl_m2f(*): version %i not supported!", (int)m->data[0]);
+  roar_err_set(ROAR_ERROR_NSVERSION);
   return -1;
  }
Index: libroar/file.c
===================================================================
--- libroar/file.c	(revision 5118)
+++ libroar/file.c	(revision 5148)
@@ -36,6 +36,6 @@
 #include "libroar.h"
 
-#define BUFSIZE 8192
-#define BUFMAX  65536
+#define BUFFERSIZE  8192
+#define BUFMAX     65536
 
 #ifdef ROAR_HAVE_IO_POSIX
@@ -97,5 +97,5 @@
 #endif
  int len;
- char buf[BUFSIZE];
+ char buf[BUFFERSIZE];
 #if defined(__linux__) && defined(ROAR_HAVE_IPV4)
  int cork_new = 1, cork_old;
@@ -118,5 +118,5 @@
  // TODO: try mmap here!
 
- while ((len = read(in, buf, BUFSIZE)) > 0)
+ while ((len = read(in, buf, BUFFERSIZE)) > 0)
   r += write(out, buf, len);
 
@@ -136,4 +136,6 @@
  int mmap_flags = 0;
  struct stat stat;
+
+ roar_debug_warn_obsolete("roar_file_map", NULL, NULL);
 
  if ( mem == NULL || filename == NULL )
@@ -183,4 +185,6 @@
 
 int     roar_file_unmap      (size_t len, void * mem) {
+ roar_debug_warn_obsolete("roar_file_unmap", NULL, NULL);
+
 #ifdef ROAR_HAVE_MMAP
  return munmap(mem, len);
@@ -205,5 +209,5 @@
  int seek;
  int len;
- char buf[BUFSIZE];
+ char buf[BUFFERSIZE];
  int rate = ROAR_RATE_DEFAULT, channels = ROAR_CHANNELS_DEFAULT, bits = ROAR_BITS_DEFAULT;
  struct roar_stream localstream[1];
@@ -213,15 +217,21 @@
  ROAR_DBG("roar_file_play_full(*) = ?");
 
- if ( !s )
+ if ( s == NULL )
   s = localstream;
 
- if ( !con )
-  return -1;
-
- if ( !file )
-  return -1;
-
- if ( exec && passfh )
-  return -1;
+ if ( con == NULL ) {
+  roar_err_set(ROAR_ERROR_FAULT);
+  return -1;
+ }
+
+ if ( file == NULL ) {
+  roar_err_set(ROAR_ERROR_FAULT);
+  return -1;
+ }
+
+ if ( exec && passfh ) {
+  roar_err_set(ROAR_ERROR_INVAL);
+  return -1;
+ }
 
 #ifdef ROAR_TARGET_WIN32
@@ -230,8 +240,10 @@
  if ( (in = open(file, O_RDONLY, 0644)) == -1 ) {
 #endif
-  return -1;
- }
-
- if ((len = read(in, buf, BUFSIZE)) < 1) {
+  roar_err_from_errno();
+  return -1;
+ }
+
+ if ((len = read(in, buf, BUFFERSIZE)) < 1) {
+  roar_err_from_errno();
   close(in);
   return -1;
@@ -245,6 +257,7 @@
 
  if ( codec == -1 ) {
-  ROAR_ERR("roar_file_play_full(*): Unknown codec of file: %s", file);
+  ROAR_WARN("roar_file_play_full(*): Unknown codec of file: %s", file);
   close(in);
+  roar_err_set(ROAR_ERROR_BADMAGIC);
   return -1;
  }
@@ -256,5 +269,5 @@
  if ( exec ) {
   if ( roar_stream_new(s, rate, channels, bits, codec) == -1 ) {
-   ROAR_ERR("roar_file_play_full(*): Can not create new stream. This is realy BAD!");
+   ROAR_DBG("roar_file_play_full(*): Can not create new stream. This is realy BAD!");
    close(in);
    return -1;
@@ -262,5 +275,5 @@
 
   if ( roar_stream_connect2(con, s, ROAR_DIR_PLAY, -1) == -1 ) {
-   ROAR_ERR("roar_file_play_full(*): Can not connect new stream to server.");
+   ROAR_DBG("roar_file_play_full(*): Can not connect new stream to server.");
    close(in);
    return -1;
@@ -268,5 +281,5 @@
 
   if ( roar_stream_exec(con, s) == -1 ) {
-   ROAR_ERR("roar_file_play_full(*): Can not exec new stream on server.");
+   ROAR_DBG("roar_file_play_full(*): Can not exec new stream on server.");
    close(in);
    return -1;
@@ -275,5 +288,5 @@
   roar_libroar_nowarn();
   if ( (out = roar_get_connection_fh(con)) == -1 ) {
-   ROAR_ERR("roar_file_play_full(*): Can not get socket of server connection for exec data transmition.");
+   ROAR_DBG("roar_file_play_full(*): Can not get socket of server connection for exec data transmition.");
    close(in);
    roar_libroar_warn();
@@ -311,5 +324,5 @@
   close(out);
 #else
- while ((len = read(in, buf, BUFSIZE)) > 0)
+ while ((len = read(in, buf, BUFFERSIZE)) > 0)
   if ( send(out, buf, len, 0) != len )
    break;
@@ -336,4 +349,5 @@
  return r;
 #else
+ roar_err_set(ROAR_ERROR_NOSYS);
  return -1;
 #endif
@@ -350,4 +364,5 @@
 #endif
 
+ roar_err_set(ROAR_ERROR_NODEV);
  return NULL;
 }
Index: libroar/simple.c
===================================================================
--- libroar/simple.c	(revision 5118)
+++ libroar/simple.c	(revision 5148)
@@ -73,4 +73,5 @@
  struct roar_connection con;
  int ret;
+ int safe_error;
 
  roar_debug_warn_sysio("roar_simple_stream_obj", NULL, NULL);
@@ -83,15 +84,21 @@
 
  if ( roar_stream_new(s, rate, channels, bits, codec) == -1 ) {
+  safe_error = roar_error;
   roar_disconnect(&con);
+  roar_err_set(safe_error);
   return -1;
  }
 
  if ( roar_stream_connect2(&con, s, dir, -1) == -1 ) {
+  safe_error = roar_error;
   roar_disconnect(&con);
+  roar_err_set(safe_error);
   return -1;
  }
 
  if ( roar_stream_exec(&con, s) == -1 ) {
+  safe_error = roar_error;
   roar_disconnect(&con);
+  roar_err_set(safe_error);
   return -1;
  }
@@ -99,6 +106,8 @@
  roar_libroar_nowarn();
  if ( (ret = roar_get_connection_fh(&con)) == -1 ) {
+  safe_error = roar_error;
   roar_libroar_warn();
   roar_disconnect(&con);
+  roar_err_set(safe_error);
   return -1;
  }
Index: libroar/socket.c
===================================================================
--- libroar/socket.c	(revision 5138)
+++ libroar/socket.c	(revision 5148)
@@ -230,4 +230,5 @@
 
  if ( (flags = fcntl(fh, F_GETFL, 0)) == -1 ) {
+  roar_err_from_errno();
   ROAR_ERR("roar_socket_nonblock(fh=%i, state=%i): Can not read flags: %s", fh, state, strerror(errno));
   ROAR_DBG("roar_socket_nonblock(fh=%i, state=%i) = -1", fh, state);
@@ -244,4 +245,5 @@
 
  if ( fcntl(fh, F_SETFL, flags) == -1 ) {
+  roar_err_from_errno();
   ROAR_ERR("roar_socket_nonblock(fh=%i, state=%i): Can not set flags: %s", fh, state, strerror(errno));
   ROAR_DBG("roar_socket_nonblock(fh=%i, state=%i) = -1", fh, state);
@@ -269,8 +271,10 @@
 
  if ( getsockname(fh, (struct sockaddr *)&socket_addr, &len) == -1 ) {
+  roar_err_from_errno();
   return -1;
  }
 
  if ( socket_addr.sin_family != AF_INET ) {
+  roar_err_set(ROAR_ERROR_TYPEMM);
   return -1;
  }
@@ -283,4 +287,5 @@
 //  if ( mode_func(fh, (struct sockaddr *)&socket_addr, sizeof(struct sockaddr_in)) == -1 ) {
  if ( bind(n, (struct sockaddr *)&socket_addr, len) == -1 ) {
+  roar_err_from_errno();
   close(n);
   return -1;
Index: libroar/stream.c
===================================================================
--- libroar/stream.c	(revision 5145)
+++ libroar/stream.c	(revision 5148)
@@ -67,5 +67,5 @@
  roar_stream_s2m(&ms, &m);
 
- if ( roar_req(con, &m, NULL) != 0 )
+ if ( roar_req3(con, &m, NULL) != 0 )
   return -1;
 
