From e0fac0b68ff23a87da3eda4ced7a60b3e2fcf77a Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Mon, 8 Apr 2013 00:46:27 +0530 Subject: glusterfsd: Cleanup temporary files from /tmp For each gluster{d,fs,fsd} start, one or more temporary file(s) created in /tmp were not being unlinked. This patch cleans that up. Modified a typo in an unrelated log message as well. Change-Id: I3dec2a2ca40c7d6828eb238ec9cd08b6072cf0dd BUG: 949327 Signed-off-by: Vijay Bellur Reviewed-on: http://review.gluster.org/4786 Reviewed-by: Krishnan Parthasarathi Reviewed-by: Raghavendra Bhat Tested-by: Gluster Build System --- libglusterfs/src/graph.y | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/graph.y b/libglusterfs/src/graph.y index 92267c4c7..e2f16ff71 100644 --- a/libglusterfs/src/graph.y +++ b/libglusterfs/src/graph.y @@ -567,6 +567,12 @@ glusterfs_graph_construct (FILE *fp) if (-1 == tmp_fd) goto err; + ret = unlink (template); + if (ret < 0) { + gf_log ("parser", GF_LOG_WARNING, "Unable to delete file: %s", + template); + } + tmp_file = fdopen (tmp_fd, "w+b"); if (!tmp_file) goto err; -- cgit