diff options
| author | Sam Varshavchik | 2021-05-17 22:45:55 -0400 | 
|---|---|---|
| committer | Sam Varshavchik | 2021-05-19 08:03:44 -0400 | 
| commit | f47a71576c377269f5c5ca6156b2f319256e2738 (patch) | |
| tree | 4b7a91e9ab6b3f52f5667e1f1a3abff1841f0b2f /maildrop/main.C | |
| parent | 9c4bd37a0adc2ebbe1ad35d6317da02e4bbfcfb2 (diff) | |
| download | courier-libs-f47a71576c377269f5c5ca6156b2f319256e2738.tar.bz2 | |
maildrop: clean up a dotlock file if exited while it is held.
Implement exit() by throwing an exception, which will wind up and clean
up the dotlock. Catch the exception and exit(), after everything gets
cleaned up.
Diffstat (limited to 'maildrop/main.C')
| -rw-r--r-- | maildrop/main.C | 7 | 
1 files changed, 6 insertions, 1 deletions
| diff --git a/maildrop/main.C b/maildrop/main.C index df0c8ac..efc7d1f 100644 --- a/maildrop/main.C +++ b/maildrop/main.C @@ -983,7 +983,12 @@ int	fd;  		{  			if (r.ParseRecipe(in) < 0)  				return (EX_TEMPFAIL); -			r.ExecuteRecipe(); +			try { +				r.ExecuteRecipe(); +			} catch (int n) +			{ +				::exit(0); +			}  		}  	} | 
