about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-09-01 16:28:18 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-09-01 16:28:18 +0200
commit5eb6eaa6b49f03b8889fb31f99c53928f34f17aa (patch)
treec578eb854cbe1cd811d5727e23b16bd2e630bd55
parent729ce70fef0b67859c326ed0e7054cde3c7610c3 (diff)
downloadredo-c-5eb6eaa6b49f03b8889fb31f99c53928f34f17aa.tar.gz
redo-c-5eb6eaa6b49f03b8889fb31f99c53928f34f17aa.tar.xz
redo-c-5eb6eaa6b49f03b8889fb31f99c53928f34f17aa.zip
Remove empty target tempfiles
-rw-r--r--redo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/redo.c b/redo.c
index 2b6a406..9d543db 100644
--- a/redo.c
+++ b/redo.c
@@ -682,6 +682,8 @@ redo_ifchange(int targetc, char *targetv[])
 			if (stat(job->temp_target, &st) == 0 &&
 			    st.st_size > 0) {
 				rename(job->temp_target, target);
+			} else {
+				remove(job->temp_target);
 			}
 		}