mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 05:57:43 +00:00
STABLE14-windows-shell-ext-server-status-20051002
Fix the server status dialog to properly call CheckServers and fix CheckServers to properly construct the data structure for the pioctl call. (cherry picked from commit c0013b2513b206edded080f0a4cea6e7e96ab281)
This commit is contained in:
parent
df35acd30e
commit
1167dafbd3
@ -1546,7 +1546,6 @@ BOOL RemoveMount(CStringArray& files)
|
||||
register LONG code = 0;
|
||||
struct ViceIoctl blob;
|
||||
char tbuffer[1024];
|
||||
char lsbuffer[1024];
|
||||
register char *tp;
|
||||
char szCurItem[1024];
|
||||
BOOL error = FALSE;
|
||||
@ -1739,30 +1738,24 @@ BOOL CheckServers(const CString& strCellName, WHICH_CELLS nCellsToCheck, BOOL bF
|
||||
|
||||
blob.out_size = MAXSIZE;
|
||||
blob.out = space;
|
||||
memset(space, 0, sizeof(LONG)); /* so we assure zero when nothing is copied back */
|
||||
|
||||
/* prepare flags for checkservers command */
|
||||
if (nCellsToCheck == LOCAL_CELL)
|
||||
temp = 2; /* default to checking local cell only */
|
||||
else if (nCellsToCheck == ALL_CELLS)
|
||||
temp &= ~2; /* turn off local cell check */
|
||||
memset(space, 0, sizeof(afs_int32)); /* so we assure zero when nothing is copied back */
|
||||
|
||||
if (nCellsToCheck == SPECIFIC_CELL) {
|
||||
temp = 2;
|
||||
GetCellName(PCCHAR(strCellName), &info);
|
||||
strcpy(checkserv.tbuffer,info.name);
|
||||
checkserv.tsize = strlen(info.name) + 1;
|
||||
} else {
|
||||
if (nCellsToCheck != ALL_CELLS)
|
||||
temp = 2;
|
||||
strcpy(checkserv.tbuffer, "\0");
|
||||
checkserv.tsize = 0;
|
||||
}
|
||||
if (bFast)
|
||||
temp |= 1; /* set fast flag */
|
||||
|
||||
checkserv.magic = 0x12345678; /* XXX */
|
||||
checkserv.tflags = temp;
|
||||
|
||||
/* now copy in optional cell name, if specified */
|
||||
if (nCellsToCheck == SPECIFIC_CELL) {
|
||||
GetCellName(PCCHAR(strCellName), &info);
|
||||
strcpy(checkserv.tbuffer,info.name);
|
||||
checkserv.tsize = strlen(info.name) + 1;
|
||||
} else {
|
||||
strcpy(checkserv.tbuffer, "\0");
|
||||
checkserv.tsize = 0;
|
||||
}
|
||||
|
||||
checkserv.tinterval = -1; /* don't change current interval */
|
||||
|
||||
code = pioctl(0, VIOCCKSERV, &blob, 1);
|
||||
|
@ -34,7 +34,7 @@ CServerStatusDlg::CServerStatusDlg() : CDialog()
|
||||
|
||||
//{{AFX_DATA_INIT(CServerStatusDlg)
|
||||
m_bFast = FALSE;
|
||||
m_nCell = -1;
|
||||
m_nCell = LOCAL_CELL;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ BOOL CServerStatusDlg::OnInitDialog()
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
m_CellName.EnableWindow(FALSE);
|
||||
m_nCell = 0;
|
||||
m_nCell = LOCAL_CELL;
|
||||
|
||||
UpdateData(FALSE);
|
||||
|
||||
@ -93,19 +93,21 @@ void CServerStatusDlg::OnShowStatus()
|
||||
|
||||
void CServerStatusDlg::OnSpecifiedCell()
|
||||
{
|
||||
m_CellName.EnableWindow(TRUE);
|
||||
|
||||
m_nCell = SPECIFIC_CELL;
|
||||
m_CellName.EnableWindow(TRUE);
|
||||
CheckEnableShowStatus();
|
||||
}
|
||||
|
||||
void CServerStatusDlg::OnLocalCell()
|
||||
{
|
||||
m_nCell = LOCAL_CELL;
|
||||
m_CellName.EnableWindow(FALSE);
|
||||
m_ShowStatus.EnableWindow(TRUE);
|
||||
}
|
||||
|
||||
void CServerStatusDlg::OnAllCells()
|
||||
{
|
||||
m_nCell = ALL_CELLS;
|
||||
m_CellName.EnableWindow(FALSE);
|
||||
m_ShowStatus.EnableWindow(TRUE);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user