fix: check the result of deleting the relay-key temp file

This commit is contained in:
davotoula
2026-09-30 18:09:08 +02:00
parent d75719383c
commit ae3dd480d9
@@ -66,7 +66,7 @@ object RelayIdentity {
val key = KeyPair() val key = KeyPair()
file.absoluteFile.parentFile?.mkdirs() file.absoluteFile.parentFile?.mkdirs()
val tmp = File(file.absoluteFile.parentFile, "${file.name}.tmp") val tmp = File(file.absoluteFile.parentFile, "${file.name}.tmp")
tmp.delete() Files.deleteIfExists(tmp.toPath())
try { try {
Files.createFile(tmp.toPath(), PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rw-------"))) Files.createFile(tmp.toPath(), PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rw-------")))
} catch (_: UnsupportedOperationException) { } catch (_: UnsupportedOperationException) {