diff options
| author | jonesc <jonesc@a3e5c962-4219-0410-a828-e124f845ac39> | 2012-01-10 21:26:36 +0000 |
|---|---|---|
| committer | jonesc <jonesc@a3e5c962-4219-0410-a828-e124f845ac39> | 2012-01-10 21:26:36 +0000 |
| commit | 224a0990f2e6db945923f1a42f7ecb0ddb80dbd5 (patch) | |
| tree | 8c223340af68083ac9ec4a3aad756aeec72a3517 /modules/Options.pm | |
| parent | 91efcf22351b9fde05596285d7f6e411b397af4b (diff) | |
| download | MPC-mpc_performance.tar.gz | |
Tue Jan 10 21:22:32 UTC 2012 Chip Jones <jonesc@ociweb.com>mpc_performance
* modules/Options.pm:
* modules/WorkspaceCreator.pm:
Added error checks to command line options and
to generate_project_files_fork() subroutine.
Diffstat (limited to 'modules/Options.pm')
| -rw-r--r-- | modules/Options.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/Options.pm b/modules/Options.pm index a9c07e42..5c83821a 100644 --- a/modules/Options.pm +++ b/modules/Options.pm @@ -502,6 +502,13 @@ sub options { if (!defined $workers_dir) { $self->optionError('-workers_dir requires an argument'); } + + if (! -d $workers_dir) { + $self->diagnostic("Creating temp directory $workers_dir"); + unless (mkdir $workers_dir) { + $self->optionError("Unable to create temp directory $workers_dir"); + } + } } elsif ($arg eq '-workers_port') { $i++; @@ -510,6 +517,10 @@ sub options { if (!defined $workers_port) { $self->optionError('-workers_port requires an argument'); } + + if ($workers_port < 0 || $workers_port > 65535) { + $self->optionError('valid -workers_port range is between 0 and 65535'); + } } elsif ($arg eq '-ti') { $i++; |
