File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: fc9b55d65f4854e22321095ae07d1ba9d39fe86d
5
+ refs/heads/try: b8c8e43381b2b5814ca4965d2e883f78a771f262
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -100,17 +100,40 @@ fn pandoc_writer(
100
100
os:: close ( pipe_out. out ) ;
101
101
os:: close ( pipe_err. out ) ;
102
102
os:: close ( pipe_in. out ) ;
103
- os:: close ( pipe_out. in ) ;
104
- os:: close ( pipe_err. in ) ;
103
+
104
+ let stdout = result:: get ( task:: try { ||
105
+ readclose ( pipe_out. in )
106
+ } ) ;
107
+ let stderr = result:: get ( task:: try { ||
108
+ readclose ( pipe_err. in )
109
+ } ) ;
105
110
106
111
let status = run:: waitpid ( pid) ;
107
112
#debug ( "pandoc result: %i" , status) ;
108
113
if status != 0 {
114
+ #error ( "pandoc-out: %s" , stdout) ;
115
+ #error ( "pandoc-err: %s" , stderr) ;
109
116
fail "pandoc failed" ;
110
117
}
111
118
}
112
119
}
113
120
121
+ fn readclose ( fd : ctypes:: fd_t ) -> str {
122
+ import std:: os;
123
+ import std:: io;
124
+
125
+ // Copied from run::program_output
126
+ let file = os:: fd_FILE ( fd) ;
127
+ let reader = io:: FILE_reader ( file, false ) ;
128
+ let buf = "" ;
129
+ while !reader. eof ( ) {
130
+ let bytes = reader. read_bytes ( 4096 u) ;
131
+ buf += str:: from_bytes ( bytes) ;
132
+ }
133
+ os:: fclose ( file) ;
134
+ ret buf;
135
+ }
136
+
114
137
fn generic_writer ( process : fn ~( markdown : str ) ) -> writer {
115
138
let ch = task:: spawn_listener { |po : comm:: port<writeinstr>|
116
139
let markdown = "" ;
You can’t perform that action at this time.
0 commit comments