about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-03-19 22:55:07 +0000
committerEric Wong <normalperson@yhbt.net>2012-03-19 22:55:07 +0000
commita281ac1f83742c4cdea53f5a9f60bca799a1768f (patch)
treeb5b317e923387a31ead4009d756c47bd40316a08
parentbe9f64c22db52d41b9be94737b40d320ad16e026 (diff)
downloadcmogstored-a281ac1f83742c4cdea53f5a9f60bca799a1768f.tar.gz
If there are filesystem errors, hopefully syslog goes to
a different filesystem or even a different machine.
-rw-r--r--http_put.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/http_put.c b/http_put.c
index a6ff95c..cba4271 100644
--- a/http_put.c
+++ b/http_put.c
@@ -25,8 +25,11 @@ static void file_close_null(struct mog_http *http)
 {
         struct mog_file *file = &http->forward->as.file;
 
-        if (file->tmppath)
-                mog_unlink(http->svc, file->tmppath);
+        if (file->tmppath) {
+                if (mog_unlink(http->svc, file->tmppath) != 0)
+                        syslog(LOG_ERR, "Failed to unlink %s (in %s): %m",
+                               file->tmppath, http->svc->docroot);
+        }
         mog_file_close(http->forward);
         http->forward = NULL;
 }