OSX の terminal の patch コマンドでエラー

patch: **** Can't create file tmp/xxxx : No such file or directory

TMPDIR=$(TMP) としてやらないといけないみたい。