| 
						
						
						
					 | 
					 | 
					@ -1,5 +1,5 @@ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					/*
 | 
					 | 
					 | 
					 | 
					/*
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 * Copyright 1995-2014 Andrew Smith | 
					 | 
					 | 
					 | 
					 * Copyright 1995-2015 Andrew Smith | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 * Copyright 2014 Con Kolivas | 
					 | 
					 | 
					 | 
					 * Copyright 2014 Con Kolivas | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 * | 
					 | 
					 | 
					 | 
					 * | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 * This program is free software; you can redistribute it and/or modify it | 
					 | 
					 | 
					 | 
					 * This program is free software; you can redistribute it and/or modify it | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -2073,8 +2073,7 @@ ASSERT4((sizeof(shift_words) == (sizeof(char *) * SHIFT_WORDS))); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Number of workinfoids per shift
 | 
					 | 
					 | 
					 | 
					// Number of workinfoids per shift
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					#define WID_PER_SHIFT 100 | 
					 | 
					 | 
					 | 
					#define WID_PER_SHIFT 100 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					#define LOGDEBU2 LOGWARNING | 
					 | 
					 | 
					 | 
					static void make_a_shift_mark() | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					static void make_shift_marks() | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						K_TREE_CTX ss_ctx[1], m_ctx[1], wi_ctx[1], b_ctx[1]; | 
					 | 
					 | 
					 | 
						K_TREE_CTX ss_ctx[1], m_ctx[1], wi_ctx[1], b_ctx[1]; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						K_ITEM *ss_item = NULL, *m_item = NULL, *m_sh_item = NULL, *wi_item; | 
					 | 
					 | 
					 | 
						K_ITEM *ss_item = NULL, *m_item = NULL, *m_sh_item = NULL, *wi_item; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -2085,7 +2084,7 @@ static void make_shift_marks() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						BLOCKS *blocks; | 
					 | 
					 | 
					 | 
						BLOCKS *blocks; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						MARKS *marks, *sh_marks; | 
					 | 
					 | 
					 | 
						MARKS *marks, *sh_marks; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						int64_t ss_age_wid, last_marks_wid, marks_wid, prev_wid; | 
					 | 
					 | 
					 | 
						int64_t ss_age_wid, last_marks_wid, marks_wid, prev_wid; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						bool was_block = false; | 
					 | 
					 | 
					 | 
						bool was_block = false, ok; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						char cd_buf[DATE_BUFSIZ], cd_buf2[DATE_BUFSIZ]; | 
					 | 
					 | 
					 | 
						char cd_buf[DATE_BUFSIZ], cd_buf2[DATE_BUFSIZ]; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						int used_wid; | 
					 | 
					 | 
					 | 
						int used_wid; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -2106,12 +2105,12 @@ static void make_shift_marks() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if (ss_item) { | 
					 | 
					 | 
					 | 
						if (ss_item) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							tv_to_buf(&(sharesummary->lastshare), cd_buf, sizeof(cd_buf)); | 
					 | 
					 | 
					 | 
							tv_to_buf(&(sharesummary->lastshare), cd_buf, sizeof(cd_buf)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							tv_to_buf(&(sharesummary->createdate), cd_buf2, sizeof(cd_buf2)); | 
					 | 
					 | 
					 | 
							tv_to_buf(&(sharesummary->createdate), cd_buf2, sizeof(cd_buf2)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							LOGDEBU2("%s() last sharesummary %s/%s/%"PRId64"/%s/%s", | 
					 | 
					 | 
					 | 
							LOGDEBUG("%s() last sharesummary %s/%s/%"PRId64"/%s/%s", | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								 __func__, sharesummary->complete, | 
					 | 
					 | 
					 | 
								 __func__, sharesummary->complete, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								 sharesummary->workername, | 
					 | 
					 | 
					 | 
								 sharesummary->workername, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								 ss_age_wid, cd_buf, cd_buf2); | 
					 | 
					 | 
					 | 
								 ss_age_wid, cd_buf, cd_buf2); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						LOGDEBU2("%s() age sharesummary limit wid %"PRId64, __func__, ss_age_wid); | 
					 | 
					 | 
					 | 
						LOGDEBUG("%s() age sharesummary limit wid %"PRId64, __func__, ss_age_wid); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						// Find the last CURRENT mark, the shift starts after this
 | 
					 | 
					 | 
					 | 
						// Find the last CURRENT mark, the shift starts after this
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						K_RLOCK(marks_free); | 
					 | 
					 | 
					 | 
						K_RLOCK(marks_free); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -2173,28 +2172,28 @@ static void make_shift_marks() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if (m_item) { | 
					 | 
					 | 
					 | 
						if (m_item) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							last_marks_wid = marks->workinfoid; | 
					 | 
					 | 
					 | 
							last_marks_wid = marks->workinfoid; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							LOGDEBU2("%s() last mark %"PRId64"/%s/%s/%s/%s", | 
					 | 
					 | 
					 | 
							LOGDEBUG("%s() last mark %"PRId64"/%s/%s/%s/%s", | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								 __func__, marks->workinfoid, | 
					 | 
					 | 
					 | 
								 __func__, marks->workinfoid, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								 marks_marktype(marks->marktype), | 
					 | 
					 | 
					 | 
								 marks_marktype(marks->marktype), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								 marks->status, marks->description, | 
					 | 
					 | 
					 | 
								 marks->status, marks->description, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								 marks->extra); | 
					 | 
					 | 
					 | 
								 marks->extra); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} else { | 
					 | 
					 | 
					 | 
						} else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							last_marks_wid = 0; | 
					 | 
					 | 
					 | 
							last_marks_wid = 0; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							LOGDEBU2("%s() no last mark", __func__); | 
					 | 
					 | 
					 | 
							LOGDEBUG("%s() no last mark", __func__); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if (m_sh_item) { | 
					 | 
					 | 
					 | 
						if (m_sh_item) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (m_sh_item == m_item) | 
					 | 
					 | 
					 | 
							if (m_sh_item == m_item) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								LOGDEBU2("%s() last shift mark = last mark", __func__); | 
					 | 
					 | 
					 | 
								LOGDEBUG("%s() last shift mark = last mark", __func__); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							else { | 
					 | 
					 | 
					 | 
							else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								LOGDEBU2("%s() last shift mark %"PRId64"/%s/%s/%s/%s", | 
					 | 
					 | 
					 | 
								LOGDEBUG("%s() last shift mark %"PRId64"/%s/%s/%s/%s", | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									 __func__, sh_marks->workinfoid, | 
					 | 
					 | 
					 | 
									 __func__, sh_marks->workinfoid, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									 marks_marktype(sh_marks->marktype), | 
					 | 
					 | 
					 | 
									 marks_marktype(sh_marks->marktype), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									 sh_marks->status, sh_marks->description, | 
					 | 
					 | 
					 | 
									 sh_marks->status, sh_marks->description, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									 sh_marks->extra); | 
					 | 
					 | 
					 | 
									 sh_marks->extra); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} else | 
					 | 
					 | 
					 | 
						} else | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							LOGDEBU2("%s() no last shift mark", __func__); | 
					 | 
					 | 
					 | 
							LOGDEBUG("%s() no last shift mark", __func__); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if (m_item) { | 
					 | 
					 | 
					 | 
						if (m_item) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							/* First block after the last mark
 | 
					 | 
					 | 
					 | 
							/* First block after the last mark
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -2213,14 +2212,14 @@ static void make_shift_marks() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if (b_item) { | 
					 | 
					 | 
					 | 
						if (b_item) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							tv_to_buf(&(blocks->createdate), cd_buf, sizeof(cd_buf)); | 
					 | 
					 | 
					 | 
							tv_to_buf(&(blocks->createdate), cd_buf, sizeof(cd_buf)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							LOGDEBU2("%s() block after last mark %"PRId32"/%"PRId64"/%s", | 
					 | 
					 | 
					 | 
							LOGDEBUG("%s() block after last mark %"PRId32"/%"PRId64"/%s", | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								 __func__, blocks->height, blocks->workinfoid, | 
					 | 
					 | 
					 | 
								 __func__, blocks->height, blocks->workinfoid, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								 blocks_confirmed(blocks->confirmed)); | 
					 | 
					 | 
					 | 
								 blocks_confirmed(blocks->confirmed)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} else { | 
					 | 
					 | 
					 | 
						} else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (!m_item) | 
					 | 
					 | 
					 | 
							if (!m_item) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								LOGDEBU2("%s() no last mark = no last block", __func__); | 
					 | 
					 | 
					 | 
								LOGDEBUG("%s() no last mark = no last block", __func__); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							else | 
					 | 
					 | 
					 | 
							else | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								LOGDEBU2("%s() no block since last mark", __func__); | 
					 | 
					 | 
					 | 
								LOGDEBUG("%s() no block since last mark", __func__); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						INIT_WORKINFO(&wi_look); | 
					 | 
					 | 
					 | 
						INIT_WORKINFO(&wi_look); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -2244,7 +2243,7 @@ static void make_shift_marks() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								 *  for now limit it to BEFORE ss_age_wid | 
					 | 
					 | 
					 | 
								 *  for now limit it to BEFORE ss_age_wid | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								 * This will mean the shifts are created ~30s later */ | 
					 | 
					 | 
					 | 
								 * This will mean the shifts are created ~30s later */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (workinfo->workinfoid >= ss_age_wid) { | 
					 | 
					 | 
					 | 
								if (workinfo->workinfoid >= ss_age_wid) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									LOGDEBU2("%s() not enough aged workinfos (%d)", | 
					 | 
					 | 
					 | 
									LOGDEBUG("%s() not enough aged workinfos (%d)", | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										 __func__, used_wid); | 
					 | 
					 | 
					 | 
										 __func__, used_wid); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									return; | 
					 | 
					 | 
					 | 
									return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								} | 
					 | 
					 | 
					 | 
								} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -2254,7 +2253,7 @@ static void make_shift_marks() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (prev_wid > 0 && | 
					 | 
					 | 
					 | 
								if (prev_wid > 0 && | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								    (workinfo->workinfoid - prev_wid) > 6) { | 
					 | 
					 | 
					 | 
								    (workinfo->workinfoid - prev_wid) > 6) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									marks_wid = prev_wid; | 
					 | 
					 | 
					 | 
									marks_wid = prev_wid; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									LOGDEBU2("%s() OK shift stops at pool restart" | 
					 | 
					 | 
					 | 
									LOGDEBUG("%s() OK shift stops at pool restart" | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										 " count %d(%d) workinfoid %"PRId64 | 
					 | 
					 | 
					 | 
										 " count %d(%d) workinfoid %"PRId64 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										 " next wid %"PRId64, | 
					 | 
					 | 
					 | 
										 " next wid %"PRId64, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										 __func__, used_wid, WID_PER_SHIFT, | 
					 | 
					 | 
					 | 
										 __func__, used_wid, WID_PER_SHIFT, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -2264,7 +2263,7 @@ static void make_shift_marks() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								prev_wid = workinfo->workinfoid; | 
					 | 
					 | 
					 | 
								prev_wid = workinfo->workinfoid; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								// Did we hit the next block?
 | 
					 | 
					 | 
					 | 
								// Did we hit the next block?
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (b_item && workinfo->workinfoid == blocks->workinfoid) { | 
					 | 
					 | 
					 | 
								if (b_item && workinfo->workinfoid == blocks->workinfoid) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									LOGDEBU2("%s() OK shift stops at block limit", | 
					 | 
					 | 
					 | 
									LOGDEBUG("%s() OK shift stops at block limit", | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										 __func__); | 
					 | 
					 | 
					 | 
										 __func__); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									marks_wid = workinfo->workinfoid; | 
					 | 
					 | 
					 | 
									marks_wid = workinfo->workinfoid; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									was_block = true; | 
					 | 
					 | 
					 | 
									was_block = true; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -2299,8 +2298,9 @@ static void make_shift_marks() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									} | 
					 | 
					 | 
					 | 
									} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								} | 
					 | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (++used_wid >= WID_PER_SHIFT) { | 
					 | 
					 | 
					 | 
								if (++used_wid >= WID_PER_SHIFT) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									// We've got a full shift
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									marks_wid = workinfo->workinfoid; | 
					 | 
					 | 
					 | 
									marks_wid = workinfo->workinfoid; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									LOGDEBU2("%s() OK shift stops at count" | 
					 | 
					 | 
					 | 
									LOGDEBUG("%s() OK shift stops at count" | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										 " %d(%d) workinfoid %"PRId64, | 
					 | 
					 | 
					 | 
										 " %d(%d) workinfoid %"PRId64, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										 __func__, used_wid, | 
					 | 
					 | 
					 | 
										 __func__, used_wid, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										 WID_PER_SHIFT, marks_wid); | 
					 | 
					 | 
					 | 
										 WID_PER_SHIFT, marks_wid); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -2312,7 +2312,7 @@ static void make_shift_marks() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							K_RUNLOCK(workinfo_free); | 
					 | 
					 | 
					 | 
							K_RUNLOCK(workinfo_free); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						// Create the shift marker
 | 
					 | 
					 | 
					 | 
						// Create the shift mark
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if (marks_wid) { | 
					 | 
					 | 
					 | 
						if (marks_wid) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							char shift[TXT_BIG+1] = { '\0' }; | 
					 | 
					 | 
					 | 
							char shift[TXT_BIG+1] = { '\0' }; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							char des[TXT_BIG+1] = { '\0' }; | 
					 | 
					 | 
					 | 
							char des[TXT_BIG+1] = { '\0' }; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -2381,12 +2381,12 @@ static void make_shift_marks() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								 shiftcode(&(workinfo->createdate)), | 
					 | 
					 | 
					 | 
								 shiftcode(&(workinfo->createdate)), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								 shift_words[word]); | 
					 | 
					 | 
					 | 
								 shift_words[word]); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							LOGDEBU2("%s() shift='%s'", __func__, shift); | 
					 | 
					 | 
					 | 
							LOGDEBUG("%s() shift='%s'", __func__, shift); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (!marks_description(des, sizeof(des), shifttype, 0, shift, NULL)) | 
					 | 
					 | 
					 | 
							if (!marks_description(des, sizeof(des), shifttype, 0, shift, NULL)) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return; | 
					 | 
					 | 
					 | 
								return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							LOGDEBU2("%s() des='%s'", __func__, des); | 
					 | 
					 | 
					 | 
							LOGDEBUG("%s() des='%s'", __func__, des); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (was_block) { | 
					 | 
					 | 
					 | 
							if (was_block) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								// Put the block description in extra
 | 
					 | 
					 | 
					 | 
								// Put the block description in extra
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -2394,16 +2394,36 @@ static void make_shift_marks() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
											blocks->height, NULL, NULL)) | 
					 | 
					 | 
					 | 
											blocks->height, NULL, NULL)) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									return; | 
					 | 
					 | 
					 | 
									return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								LOGDEBU2("%s() extra='%s'", __func__, extra); | 
					 | 
					 | 
					 | 
								LOGDEBUG("%s() extra='%s'", __func__, extra); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							setnow(&now); | 
					 | 
					 | 
					 | 
							setnow(&now); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							marks_process(NULL, true, EMPTY, marks_wid, des, extra, | 
					 | 
					 | 
					 | 
							ok = marks_process(NULL, true, EMPTY, marks_wid, des, extra, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								      shifttype, status, (char *)by_default, | 
					 | 
					 | 
					 | 
									   shifttype, status, (char *)by_default, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								      (char *)__func__, (char *)inet_default, | 
					 | 
					 | 
					 | 
									   (char *)__func__, (char *)inet_default, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								      &now, NULL); | 
					 | 
					 | 
					 | 
									   &now, NULL); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							if (ok) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								LOGWARNING("%s() mark %"PRId64"/%s/%s/%s/%s/", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									   __func__, marks_wid, shifttype, status, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									   des, extra); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} else | 
					 | 
					 | 
					 | 
						} else | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							LOGDEBU2("%s() no marks wid", __func__); | 
					 | 
					 | 
					 | 
							LOGDEBUG("%s() no marks wid", __func__); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					static void make_a_workmarker() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						char msg[1024] = ""; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						tv_t now; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						bool ok; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						setnow(&now); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						ok = workmarkers_generate(NULL, msg, sizeof(msg), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									  (char *)by_default, (char *)__func__, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									  (char *)inet_default, &now, NULL, false); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						if (!ok) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							LOGERR("%s() ERR %s", __func__, msg); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					static void *marker(__maybe_unused void *arg) | 
					 | 
					 | 
					 | 
					static void *marker(__maybe_unused void *arg) | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -2443,9 +2463,8 @@ static void *marker(__maybe_unused void *arg) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (everyone_die) | 
					 | 
					 | 
					 | 
							if (everyone_die) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								break; | 
					 | 
					 | 
					 | 
								break; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							else | 
					 | 
					 | 
					 | 
							else | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								make_shift_marks(); | 
					 | 
					 | 
					 | 
								make_a_shift_mark(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					#if 0 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							for (i = 0; i < 4; i++) { | 
					 | 
					 | 
					 | 
							for (i = 0; i < 4; i++) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (!everyone_die) | 
					 | 
					 | 
					 | 
								if (!everyone_die) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									sleep(1); | 
					 | 
					 | 
					 | 
									sleep(1); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -2455,6 +2474,7 @@ static void *marker(__maybe_unused void *arg) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							else | 
					 | 
					 | 
					 | 
							else | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								make_a_workmarker(); | 
					 | 
					 | 
					 | 
								make_a_workmarker(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					#if 0 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							for (i = 0; i < 4; i++) { | 
					 | 
					 | 
					 | 
							for (i = 0; i < 4; i++) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (!everyone_die) | 
					 | 
					 | 
					 | 
								if (!everyone_die) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									sleep(1); | 
					 | 
					 | 
					 | 
									sleep(1); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |