aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2014-03-15 17:29:56 +0100
committerGravatar Christian Hesse <mail@eworm.de>2014-03-15 17:29:56 +0100
commit565ff71af87b24c5746017ee51858fd8649beef9 (patch)
tree9346c718e579d99ee1aeff5ae26da798ed29797c
parent8257e4f7d9c5123ecc227a828a460e756e897567 (diff)
downloadmkinitcpio-ykfde-565ff71af87b24c5746017ee51858fd8649beef9.tar.gz
mkinitcpio-ykfde-565ff71af87b24c5746017ee51858fd8649beef9.tar.zst
unlink challenge file only on success
-rw-r--r--udev/ykfde.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/udev/ykfde.c b/udev/ykfde.c
index 1c45833..2077583 100644
--- a/udev/ykfde.c
+++ b/udev/ykfde.c
@@ -256,10 +256,11 @@ out30:
free(challenge);
out20:
- /* close and unlink challenge file
- * we can not try again later! */
+ /* close the challenge file */
fclose(challengefile);
- unlink(CHALLENGEFILE);
+ /* Unlink it if we were successful, we can not try again later! */
+ if (ret == EXIT_SUCCESS)
+ unlink(CHALLENGEFILE);
out10:
return ret;