mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	Merge "sched.c: Add warning about negative time interval request."
This commit is contained in:
		
							
								
								
									
										11
									
								
								main/sched.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								main/sched.c
									
									
									
									
									
								
							| @@ -450,6 +450,17 @@ static int sched_settime(struct timeval *t, int when) | ||||
| { | ||||
| 	struct timeval now = ast_tvnow(); | ||||
|  | ||||
| 	if (when < 0) { | ||||
| 		/* | ||||
| 		 * A negative when value is likely a bug as it | ||||
| 		 * represents a VERY large timeout time. | ||||
| 		 */ | ||||
| 		ast_log(LOG_WARNING, | ||||
| 			"Bug likely: Negative time interval %d (interpreted as %u ms) requested!\n", | ||||
| 			when, (unsigned int) when); | ||||
| 		ast_assert(0); | ||||
| 	} | ||||
|  | ||||
| 	/*ast_debug(1, "TV -> %lu,%lu\n", tv->tv_sec, tv->tv_usec);*/ | ||||
| 	if (ast_tvzero(*t))	/* not supplied, default to now */ | ||||
| 		*t = now; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user