lib/file: move the call of `stdout.set_buffering_mode` to Stdout
authorJean Privat <jean@pryen.org>
Fri, 6 Mar 2015 03:53:54 +0000 (10:53 +0700)
committerJean Privat <jean@pryen.org>
Fri, 6 Mar 2015 03:53:54 +0000 (10:53 +0700)
Signed-off-by: Jean Privat <jean@pryen.org>

lib/standard/file.nit

index 2009a50..2f24cb9 100644 (file)
@@ -254,6 +254,7 @@ class Stdout
                _file = new NativeFile.native_stdout
                path = "/dev/stdout"
                _is_writable = true
+               set_buffering_mode(256, sys.buffer_mode_line)
        end
 end
 
@@ -998,10 +999,6 @@ end
 
 redef class Sys
 
-       init do
-               if stdout isa FileStream then stdout.as(FileStream).set_buffering_mode(256, buffer_mode_line)
-       end
-
        # Standard input
        var stdin: PollableReader = new Stdin is protected writable