Index: src/rrd_daemon.c
===================================================================
--- src/rrd_daemon.c	(revision 1626)
+++ src/rrd_daemon.c	(working copy)
@@ -1267,7 +1267,7 @@
       struct stat statbuf;
 
       memset(&statbuf, 0, sizeof(statbuf));
-      if (stat(file, &statbuf) == 0 && S_ISREG(statbuf.st_mode))
+      if (rrd_stat(file, &statbuf) == 0 && S_ISREG(statbuf.st_mode))
         return send_response(sock, RESP_OK, "Nothing to flush: %s.\n", file);
       else
         return send_response(sock, RESP_ERR, "No such file: %s.\n", file);
@@ -1411,7 +1411,7 @@
     pthread_mutex_unlock(&cache_lock);
 
     memset (&statbuf, 0, sizeof (statbuf));
-    status = stat (file, &statbuf);
+    status = rrd_stat (file, &statbuf);
     if (status != 0)
     {
       RRDD_LOG (LOG_NOTICE, "handle_request_update: stat (%s) failed.", file);
@@ -1426,7 +1426,7 @@
     if (!S_ISREG (statbuf.st_mode))
       return send_response(sock, RESP_ERR, "Not a regular file: %s\n", file);
 
-    if (access(file, R_OK|W_OK) != 0)
+    if (rrd_access(file, R_OK|W_OK) != 0)
       return send_response(sock, RESP_ERR, "Cannot read/write %s: %s\n",
                            file, rrd_strerror(errno));
 
@@ -1775,7 +1775,7 @@
     struct stat statbuf;
 
     memset(&statbuf, 0, sizeof(statbuf));
-    if (stat(file, &statbuf) != 0)
+    if (rrd_stat(file, &statbuf) != 0)
     {
       if (errno == ENOENT)
         return 0;
Index: src/rrd.h
===================================================================
--- src/rrd.h	(revision 1626)
+++ src/rrd.h	(working copy)
@@ -378,6 +378,14 @@
     int       rrd_lock(
     rrd_file_t *file)
               RRD_DEPRECATED;
+    int rrd_access(
+    const char* path,
+    int amode)
+              RRD_DEPRECATED;
+    int rrd_stat(
+    const char *restrict path,
+    struct stat *restrict buf)
+              RRD_DEPRECATED;
     void      rrd_notify_row(
     rrd_file_t *rrd_file,
     int rra_idx,
Index: src/rrd_open.c
===================================================================
--- src/rrd_open.c	(revision 1626)
+++ src/rrd_open.c	(working copy)
@@ -430,7 +430,22 @@
     return (rcstat);
 }
 
+/*
+ * rrd implementation of access(2)
+ */
+int rrd_access(const char* path, int amode)
+{
+    return access(path, amode);
+}
 
+/*
+ * rrd implementation of stat(2)
+ */
+int rrd_stat(const char *restrict path, struct stat *restrict buf)
+{
+    return stat(path, buf);
+}
+
 /* drop cache except for the header and the active pages */
 void rrd_dontneed(
     rrd_file_t *rrd_file,
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 1626)
+++ src/Makefile.am	(working copy)
@@ -105,9 +105,9 @@
 rrdtool_LDADD	= librrd.la
 
 rrdcached_SOURCES = rrd_daemon.c
-rrdcached_DEPENDENCIES = librrd_th.la
+rrdcached_DEPENDENCIES = librrd_th.la librrdupd.la
 rrdcached_CPPFLAGS = -DVERSION='"$(VERSION)"' -DLOCALSTATEDIR='"$(localstatedir)"'
-rrdcached_LDADD = librrd_th.la
+rrdcached_LDADD = librrd_th.la librrdupd.la
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = librrd.pc
