implement new version of lpt_lock call to properly handle early calls of this function
This commit is contained in:
		
							
								
								
									
										12
									
								
								yasnd.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								yasnd.c
									
									
									
									
									
								
							@@ -74,9 +74,9 @@ void lpt_init()
 | 
				
			|||||||
	This is needed to lock LPT control circuit, when
 | 
						This is needed to lock LPT control circuit, when
 | 
				
			||||||
	management computer is rebooted
 | 
						management computer is rebooted
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
void lpt_lock()
 | 
					void lpt_lock_cond(bool ignore_options)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (lpt_enable)
 | 
						if (lpt_enable || ignore_options)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		if (ioperm (lpt_port, 3, 1))
 | 
							if (ioperm (lpt_port, 3, 1))
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
@@ -90,6 +90,12 @@ void lpt_lock()
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Previous function, but without ignoring lpt_enable option
 | 
				
			||||||
 | 
					void lpt_lock()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return lpt_lock_cond(false);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Function, that checks that defined host entry is valid
 | 
					// Function, that checks that defined host entry is valid
 | 
				
			||||||
int cb_validate_host(cfg_t *cfg, cfg_opt_t *opt)
 | 
					int cb_validate_host(cfg_t *cfg, cfg_opt_t *opt)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -384,7 +390,7 @@ void arg_parse(int argc, char *argv[])
 | 
				
			|||||||
		switch(c)
 | 
							switch(c)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			case 'i':
 | 
								case 'i':
 | 
				
			||||||
				lpt_lock();
 | 
									lpt_lock_cond(true);
 | 
				
			||||||
				exit(EXIT_SUCCESS);
 | 
									exit(EXIT_SUCCESS);
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			default:
 | 
								default:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user