소스 검색

make tmpfile slightly more efficient (use unlink syscall instead of remove)

Rich Felker 14 년 전
부모
커밋
b172dc8b58
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/stdio/tmpfile.c

+ 1 - 1
src/stdio/tmpfile.c

@@ -17,7 +17,7 @@ FILE *tmpfile(void)
 		fd = syscall(SYS_open, s, O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600);
 		if (fd >= 0) {
 			f = __fdopen(fd, "w+");
-			remove(s);
+			syscall(SYS_unlink, s);
 			return f;
 		}
 	}