shithub: drawterm

Download patch

ref: 550a8ec5f943b87172668581e67128d4770c6e48
parent: fd5ced871042acc294faa2dd2118ad8fe2c61ea2
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Sep 5 04:56:13 EDT 2018

devfs-posix: error on rename when newpath already exists

--- a/kern/devfs-posix.c	Sat Sep  1 12:47:39 2018
+++ b/kern/devfs-posix.c	Wed Sep  5 04:56:13 2018
@@ -429,6 +429,8 @@
 			free(newpath);
 			nexterror();
 		}
+		if(stat(newpath, &stbuf) >= 0)
+			error(Eexist);
 		if(rename(uif->path, newpath) < 0)
 			error(strerror(errno));
 		free(uif->path);