Add way of including all stderr output when executing command
authorBrian Wolff <bawolff+wn@gmail.com>
Thu, 12 Sep 2013 01:40:56 +0000 (22:40 -0300)
committerBrian Wolff <bawolff+wn@gmail.com>
Sat, 28 Sep 2013 20:48:37 +0000 (17:48 -0300)
commit37e32abb0ecb3f34ba8d6f1d1306d0769598eb51
tree779275c725d84907774bc1aa67e77eb5c647237d
parenta5502893899a3a71fdfa62f4692dea752bef2eee
Add way of including all stderr output when executing command

This adds an option to wfShellExec (and convenience function
wfShellExecWithStderr), to make sure all stderr is duplicated
to stdout. The previous method of doing this was to include
2>&1 on the command line. However this did not redirect errors
from limit.sh (For example cgroups not set up, or if a command
reached the file size limit set by ulimit).

Not sure if this is the best approach, but it seems to work well,
and compared to most other approaches I considered, actually gets
the ulimit errors redirected too.

Currently some files fail to render with no error whatsoever,
hopefully this patch will make what went wrong more obvious.

Also fix a comment in wfShellExec that was incorrect (trailing \n),
and make the initial value of the return value variable be 200, so
if there's ever a bug in php where its not being set properly, it
would be immediately obvious what is happening.

Bug: 53824
Change-Id: I833aeb3ab9da726ecb97331369ea187daad7e795
includes/GlobalFunctions.php
includes/media/Bitmap.php
includes/media/Jpeg.php
includes/media/SVG.php
includes/upload/UploadBase.php