Browse Source

Ran formatting for freopen()

Tom Almeida 7 years ago
parent
commit
81d96c214a
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/stdio/src/lib.rs

+ 5 - 2
src/stdio/src/lib.rs

@@ -320,7 +320,8 @@ pub unsafe extern "C" fn freopen(
     flockfile(stream);
 
     helpers::fflush_unlocked(stream);
-    if filename.is_null() { // Reopen stream in new mode
+    if filename.is_null() {
+        // Reopen stream in new mode
         if flags & fcntl::O_CLOEXEC > 0 {
             fcntl::sys_fcntl((*stream).fd, fcntl::F_SETFD, fcntl::FD_CLOEXEC);
         }
@@ -339,7 +340,9 @@ pub unsafe extern "C" fn freopen(
         }
         if (*new).fd == (*stream).fd {
             (*new).fd = -1;
-        } else if platform::dup2((*new).fd, (*stream).fd) < 0 || fcntl::sys_fcntl((*stream).fd, fcntl::F_SETFL, flags&fcntl::O_CLOEXEC) < 0 {
+        } else if platform::dup2((*new).fd, (*stream).fd) < 0
+            || fcntl::sys_fcntl((*stream).fd, fcntl::F_SETFL, flags & fcntl::O_CLOEXEC) < 0
+        {
             fclose(new);
             funlockfile(stream);
             fclose(stream);