File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,9 @@ function get_batch_tar() {
110110 //
111111 $ cmd = "cd $ dir; tar --totals -cf /dev/null * 2>&1 " ;
112112 $ f = popen ($ cmd , "r " );
113+ if (!$ f ) {
114+ error_page ('tar --totals failed ' );
115+ }
113116 $ nbytes = -1 ;
114117 while (1 ) {
115118 $ out = fgets ($ f );
@@ -121,16 +124,19 @@ function get_batch_tar() {
121124 }
122125 }
123126 if ($ nbytes <0 ) {
124- error_page ('tar --totals failed ' );
127+ error_page ('tar --totals didn ' t produce result ');
125128 }
126129 pclose ($ f );
127130
128131 // generate tar file and stream to output
129132 //
130133 $ name = "batch_ $ batch_id.tar " ;
131134 download_header ($ name , $ nbytes );
132- $ cmd = " cd $ dir; tar -cf - * " ;
135+ $ cmd = "cd $ dir; tar -cf - * " ;
133136 $ f = popen ($ cmd , "r " );
137+ if (!$ f ) {
138+ error_page ('tar failed ' );
139+ }
134140 while (1 ) {
135141 $ data = fread ($ f , 256 *1024 );
136142 if (!$ data ) {
You can’t perform that action at this time.
0 commit comments