Przeglądaj źródła

修复 fsync 错误码问题

Rbb666 3 lat temu
rodzic
commit
988e0d11dc
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      components/lwp/lwp_syscall.c

+ 4 - 1
components/lwp/lwp_syscall.c

@@ -4116,7 +4116,10 @@ int sys_sched_getscheduler(int tid, int *policy, void *param)
 
 
 int sys_fsync(int fd)
 int sys_fsync(int fd)
 {
 {
-    return fsync(fd);
+    int res = fsync(fd);
+    if (res < 0)
+        res = rt_get_errno();
+    return res;
 }
 }
 
 
 const static void* func_table[] =
 const static void* func_table[] =