Parcourir la source

fix tftp create file fail bug

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@819 bbd45198-f89e-11dd-88c7-29a3b14d5316
qiuyiuestc il y a 15 ans
Parent
commit
9f10586059
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      components/net/apps/tftp.c

+ 1 - 1
components/net/apps/tftp.c

@@ -26,7 +26,7 @@ void tftp_get(const char* host, const char* dir, const char* filename)
 		"%s/%s", dir, filename);
 
 	/* open local file for write */
-	fd = open((char*)tftp_buffer, O_RDWR, 0);
+	fd = open((char*)tftp_buffer, O_RDWR | O_CREAT, 0);
 	if (fd < 0)
 	{
 		rt_kprintf("can't open local filename\n");